Hi ,
I need some suggestion on how to search for any alphanumeric range search if its possible in elasticsearch.
I have gone through the below link , I am not able to find any solution for alphanumeric search. https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
Example . I have a field called "page_number" which stores D1-D4. if user search for page number something like D3 , is there any possible way to search in elasticsearch in between pages?
You would not be able to use the range datatype for that. Instead, you could separately index the bottom and upper end of the range, and then query those values using a bool query.
For example, given this document:
PUT my_index/_doc/1
{
"page_number_min": "D1",
"page_number_max": "D4"
}
Hi @abdon ,
I have tried the method that you have mentioned above but its ain't working.
I have made pageno and endpageno as the image below as keyword field. but its not working
HI @abdon,
Thanks for your reply . But for me, pageno and endpageno is already a keyword field so it will not be analyzed.
Please see the below screenshot:
HI @abdona and @Ignacio_Vera,
Thanks for helping me out in this, I have used as a part of filter to search for the page number range and its working for both alphanumeric and integer data.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.