concept size in category elasticsearch

appears as: size
Elasticsearch in Action

This is an excerpt from Manning's book Elasticsearch in Action.

The total number of documents may not match the number of documents you see in the reply. By default, Elasticsearch limits the number of results to 10, so if you can have more than 10 results, look at the value of total for the precise number of documents that match your search criteria. As you saw previously, to change the number of results returned, use the size parameter.

Listing 4.2. Paginating results using from and size

By setting search_type to count in the URI parameters, you tell Elasticsearch that you’re not interested in the query results, only in their number. We’ll look at count and other search types later in this section. In Elasticsearch 2.0, setting size to 0 will also work and search_type=count will be deprecated.[7]

In chapter 4, you learned that you’d use size and from to paginate the results of your query. For example, to search for “elasticsearch” in get-together events and get the fifth page of 100 results, you’d run a request like this:

sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest