The above query doesn't work , if "myStringTypeFieldName" is replaced with a "Date-Type" Field
I am getting IllegalArgument exception.
Because , wildcard works only with string types
Is there any way in Elasticsearch to achieve the same , if the searched field type is Date
PS:
I am trying to implement an application, which executes the the above query with date-field in ES ,
sometimes with the "date-value" | sometimes with "empty-value"
I will be very pleased if someone can enlighten me on this
You selected 'Mobile' from the category and you get the paginated result
Then on sidebar-panel you have multiple filter-checkbox
Now suppose
One of the checkbox value is "2017" :
On checking it will call a rest-api-url which will query ES to return all the mobiles launched in 2017
Another checkbox value is "Android" :
On clicking which it will call the same rest-api-url, which will query ES to return all the Android mobiles
CASE I : you checked "2017"
: A query in ES is called to get all the mobiles launched in 2017 , here in ES query
date-field : which is a Date type will be having exact value which is 2017 here
brand-field : which is a String type is empty
Case II : you unchecked the "2017" and checked "Android"
: Same query in ES is called to get all the Android Mobiles but here in ES query
date-field-type : which is a Date type will be "empty" , which will match mobiles in every year
brand-field : which is a string type with value "Android"
In my scenario , Case II is not working and giving me illegal-argument exception on date-field
Yes , I also tried the same
Its working, when i am writing separate queries.
But i am trying to dynamically insert values in "brand" and "date" range , So that i need to write only one query for all the cases/filters possible
Cause i have many filters on my application.
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.