Are you using "default_operator": "AND" in query string?
I believe you are not declaring an analyzer in the customer_id field, so elasticsearch by default will apply the "standard" analyzer. This analyzer will generate several tokens for your customer Id ex: [1c0298d6, a911, 5044-a904, 6e848fb05eef], note that the token 1c0298d6 exists in doc 1c0298d6-a911-5044-a904-6e848fb18vit so this document will always be retrieved.
I would use the Term Query for this type of search (the customer id will have to be of the Keyword type) or if you want to keep the query string you will have to use the "default_operator": "AND" because that way you guarantee that all tokens are matched.
yes I am not declaring an analyzer in customer_id field, I am dumping the whole json into the index for now. I was going for the term query but it was giving no result, I believe due to customer_id currently being a text field.
I thought "AND" would be used as default in simple_query_string if no operator is provided.
Thanks for your response!
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.