What's the best way in order to get all ids of a type using Java API?
Thanks.
What's the best way in order to get all ids of a type using Java API?
Thanks.
Hi,
you can use the Scroll API together with a match_all query. But the better question is why you just need the ids.
Daniel
But it is good to remember that this isn't what Elasticsearch is good at - those _ids are stored with the _source so they can be slower to fetch. Elasticsearch's aggregations are fast because they use a column store (doc values). _id doesn't have that.
If performance is good enough for you then it is fine, but if it isn't then you are often better off thinking of reworking what you want to do as some kind of aggregation.
© 2020. All Rights Reserved - Elasticsearch
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.