Global Search Query

I am working on the Global Search functionality which include mathematical comparision operation like (=,>,<) , I am looking for the solution how to infer the field and then search the text or value meaning I can give user a felexiblity to type anything in global search textbox while serarching with expression instead of actual field for example I want to search accounts with "market value < $5000" , system don't have any idea what field user is typing for meaning user want market value but in index it is amount or amtMarketValue in this case system has to infer what field meaning market value = amtMarketValue /amount and then execute the query, how can I achive to infer the field and then apply search.

Welcome to our community! :smiley:

I guess that depends on how you want things to work. You can just search every field in the index and see what matches, that's easy in Elasticsearch. Or you could use field aliases to put some basic matching in place.

Otherwise if you want to be smarter then you will want to build that functionality into Elasticsearch, as it's not something it can do.

1 Like

Thanks Mark !!

I can do match all the fields in the index, the example I gave that is a mathematical problem I need to know if user is typing math problem or a text as it is a global search where user is going to type anything like we do use the google search box, I know we have a query_string for similar problem but it has its own grammar if I can get a function or solution which allow me to write my own grammar that would be great is it possible with Elastic Search or you suggest something that would be a great help.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.