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 from
and 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
Running Pod Setup Gives Me "Bad Interpreter: No Such File or Directory" Error
Determine Ruby Version from Within Rails
Capistrano Ssh::Authenticationfailed, Not Prompting for Password
Difference Between @Instance_Variable and Attr_Accessor
Best Practice for Rails App to Run a Long Task in the Background
What's the Difference Between To_A and To_Ary
Ruby Convert Array to Nested Hash
Rails 4 Unpermitted Parameters for Array
How to Pass an Argument to Array.Map Short Cut
Libxml2 Missing MAC Os X 10.10
Rvm Ruby 1.9.1 Install Can't Locate Zlib But Its Runtime and Dev Library Are There
A Copy of Xxx Has Been Removed from the Module Tree But Is Still Active
Comparing Two Arrays Ignoring Element Order in Ruby
Can Rails Migrations Be Used to Convert Data
How to Change All the Keys of a Hash by a New Set of Given Keys
Docker for MAC - Mkmf.Rb Can't Find Header Files for Ruby
Finding the Element of a Ruby Array with the Maximum Value for a Particular Attribute