What I would like to understand, is how to manage queries templates to control search results.
Here's an example: let's assume we have three daily indices:
So, if logstash-data-* has multiple entries like for instance: 12345678, 123456789, 12345678A
All of them will match and Logstash will simply take the first result.
What I would like to achieve is for Logstash to look for the exact match.
Is it possible to achieve this by using this query template here?
Thank you @dadoonet, just one more clarification please: if Elasticsearch finds more than one entry, given that result_size => 1, which will be the sorting order?
Is it correct to assume that the default is "sort" : [ { "@timestamp" : "desc" } ]?
[Edit] I tested the query
GET logstash-data-*/_search?q=object:12345678
Against my actual Elasticsearch indexes, and I receive the multiple results in a sort-of random ordering (they are apparently ordered by "_score" but not by @timestamp or index name)
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.