Class: JayAPI::Elasticsearch::SearchAfterResults

Inherits:
QueryResults
  • Object
show all
Defined in:
lib/jay_api/elasticsearch/search_after_results.rb

Overview

A QueryResults class for the ‘search_after’ type of query. See more: www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html

Constant Summary collapse

DEFAULT_FROM =

The default ‘from’ attribute for the ‘search_after’ query. See the link for more details. www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#:~:text=(default)%20or-,%2D1,-.

-1

Instance Attribute Summary

Attributes inherited from QueryResults

#batch_counter, #index, #query, #response

Instance Method Summary collapse

Methods inherited from QueryResults

#all, #each, #initialize

Constructor Details

This class inherits a constructor from JayAPI::Elasticsearch::QueryResults

Instance Method Details

#more?true

Returns It should always be assumed that there are more results when using ‘search_after’ parameter.

Returns:

  • (true)

    It should always be assumed that there are more results when using ‘search_after’ parameter



17
18
19
# File 'lib/jay_api/elasticsearch/search_after_results.rb', line 17

def more?
  true
end

#next_batchJayAPI::Elasticsearch::QueryResults

Fetches the next batch of documents.

Returns:



25
26
27
# File 'lib/jay_api/elasticsearch/search_after_results.rb', line 25

def next_batch
  index.search(adapt_query, batch_counter: batch_counter, type: :search_after)
end