Hello all, we are now query elasticsearch to get exactly documents which have ID should match one in the ID array. It's smiliar to the following SQL query:
SELECT * FROM myindex WHERE transaction_id IN (id1, id2, id3)
However, with ~136 million document (continue growing) and size of the ID array is ~5000, this query come extremely slow.
Any suggestion to optimize this?
The terms query (docs) is designed to match one of many terms. Have a look at that one. It isn't analyzed and doesn't support phrase queries, only single terms, but it might help here if you can use it.
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.