class Misc::TermsLookup

Terms lookup fetches the field values of an existing document. Elasticsearch then uses those values as search terms. This can be helpful when searching for a large set of terms. Because terms lookup fetches values from a document, the _source mapping field must be enabled to use terms lookup. The _source field is enabled by default.

Public Class Methods

new(index:, id:, path:) click to toggle source

@params [String] index index name @params [String] id document id @params [String] path name of the field to fetch values from

# File lib/misc/terms_lookup.rb, line 15
def initialize(index:, id:, path:)
  @index = index
  @id = id
  @path = path
end

Public Instance Methods

id_expr() click to toggle source

@!visibility protected

# File lib/misc/terms_lookup.rb, line 36
def id_expr
  @id
end
index_expr() click to toggle source

@!visibility protected

# File lib/misc/terms_lookup.rb, line 31
def index_expr
  @index
end
path_expr() click to toggle source

@!visibility protected

# File lib/misc/terms_lookup.rb, line 41
def path_expr
  @path
end
settings() click to toggle source

@return [Hash] serialized json query for the object

# File lib/misc/terms_lookup.rb, line 22
def settings
  settings = {}
  settings[:index] = @index.intern
  settings[:id] = @id.intern
  settings[:path] = @path.intern
  settings
end