so i have a field named subjects, it is an array. so I want to get all the values of subjects field in a particular index. should be about 300-400. Can someone suggest how to achieve this.
I am doing this: GET /index/_search { "size": "0", "aggs":{ "by_subjects":{ "terms": { "field": "subjects.en.keyword" } } } }
but this is returning me only 10 items in a list.
also its giving me this in result if it helps: "aggregations" : { "by_subjects" : { "doc_count_error_upper_bound" : 0, "sum_other_doc_count" : 381,
Use the size parameter to ask for more. Given you have hundreds, not tens of thousands of values, these can all be returned from a single request (otherwise you'd need to use something like the composite aggregation to page through results).
hello,
making the size parameter to 400 (keeping rest same) gives me all the documents I have stored in the index.
my goal is to get all the values of the particular field.
Thanks
I did try that before and just now as well. its still seems to give me same results, giving me all the documents in the index. Is there anything I am missing. this is my query .
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.