Filter or analyzer to match English digits to Arabic numerals

I am running Elasticsearch server.

I would like a query like fifty two meters to match a document containing 52 meters .

Is there any plugin (filter or analyzer) that converts numeric words to Arabic numerals?

+7
elasticsearch elasticsearch-plugin
source share
1 answer

There is currently no plugin for elasticsearch to convert words to numbers.

I suggest you create code that receives a raw query as input and outputs a converted query (for example: converting words to numbers) to search for elasticsearch.

You can use this ruby ​​stone (open-source) to convert words to numbers and vice versa.

 NumbersInWords.in_numbers("nineteen sixty five") 1965 

And to facilitate the ruby intergration process for elasticsearch , you can use elasticsearch to finally query and get the results.

 require 'elasticsearch' client = Elasticsearch::Client.new log: true client.transport.reload_connections! client.cluster.health client.search q: 'test' 
+4
source share

All Articles