im looking for the bug in the following query, as it doesn't bring any results. i want it to act like terms filter, and look for exact values in the country / device fields
This query is basically a match all that filters on country and device. You can use a simple boolean query with 2 must clauses, each clause being a match query (or term query if your fields are not_analyzed)
The query_string query can be very trappy, I personally prefer to use a combination ofbool, match or term queries.
Also, do you have control over the possible values for country and device fields? It looks like to me that the values come from a predefined set of values (maybe a drop down list in a web form?) If so, why not using term queries directly?
country and device are indeed lists, but there are more fields that are not predefined, with long list of values.
if i want to reindex, with new mapping, can i keep somehow the original values, and also have the ability to search case-insensitive search?
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.