Setting Elastic Search Limit to "Unlimited"

Setting Elastic search limit to unlimited

You can use the from and size parameters to page through all your data. This could be very slow depending on your data and how much is in the index.

http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html

Elasticsearch query with unlimited size

Yes, you can use the Scroll API.
documentation - https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html

this will allow you to get unlimited data, you specificy a size and will get it in batches.
hope that helps :)

Elastic Search size to unlimited

It's not very common to display all results, but rather use fromand size to specify a range of results to fetch. So your query (for fetching the first 10 results) should look something like this:

{
"from": 0,
"size": 10,
"query": {
"match": {
"first_name": "vineeth"
}
}
}

This should work better than setting size to a ridiculously large value. To check how many documents matched your query you can get the hits.total (total number of hits) from the response.

How to set elasticsearch index.mapping.total_fields.limit to unlimited

I don't think that current implementation allow you to set this value to unlimited.

As you probably know the default value is already high(1000) as described in official docs.

And if you check the source code you can see that current implementation does not allow for unlimited(like setting to -1 for instance), as you can see in the following fragment of code taken from official elasticsearch source code:

private void checkTotalFieldsLimit(long totalMappers) {
long allowedTotalFields = indexSettings.getValue(INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING);
if (allowedTotalFields < totalMappers) {
throw new IllegalArgumentException("Limit of total fields [" + allowedTotalFields + "] in index [" + index().getName() + "] has been exceeded");
}
}

I believe your best option is to set it to a very high value when mapping your index and check if the overhead is acceptable for your use case.

Alternative for LIMIT in elasticsearch

You can use From/Size in ElasticSearch to limit the results.

Please check the below link for further details.

https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-from-size.html#search-request-from-size



Related Topics



Leave a reply



Submit