Filter or analyzer to equate English numbers and arabic numerals

I'm running an Elasticsearch server.

I'd like a query such as fifty two meters to match a document containing 52 meters .

Is there any plugin (filter or analyzer) that converts number words to arabic numerals?


Currently there is no plug-in for elasticsearch to convert words to number.

I suggest you to create a code that gets raw query as an input and outputs the transformed the query (ie: convert words to number) for elasticsearch.

You can use this ruby gem (open-source) to convert words to number and vice versa.

NumbersInWords.in_numbers("nineteen sixty five")
1965

And to make things easier ruby intergration for elasticsearch can used to finally query the elasticsearch and get the results.

require 'elasticsearch'

client = Elasticsearch::Client.new log: true

client.transport.reload_connections!

client.cluster.health

client.search q: 'test'
链接地址: http://www.djcxy.com/p/94286.html

上一篇: MySQL中的多个更新

下一篇: 过滤器或分析器将英文数字和阿拉伯数字等同起来