Class: Esearch::Presenter::Hit

Inherits:
Esearch::Presenter show all
Defined in:
lib/esearch/presenter/hit.rb

Overview

Presenter for an hit

Instance Method Summary collapse

Instance Method Details

#_idString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return id

Returns:

  • (String)


59
# File 'lib/esearch/presenter/hit.rb', line 59

expose_primitive(:_id, :id)

#_indexString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return index name

Returns:

  • (String)


43
# File 'lib/esearch/presenter/hit.rb', line 43

expose_primitive(:_index, :index_name)

#_scoreFloat

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return score

Returns:

  • (Float)


67
# File 'lib/esearch/presenter/hit.rb', line 67

expose_primitive(:_score, :score)

#_typeType

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return type name

Returns:



51
# File 'lib/esearch/presenter/hit.rb', line 51

expose_primitive(:_type, :type_name)

#fieldsHash?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return fields if present

Returns:

  • (Hash)

    if present

  • (nil)

    otherwise



33
34
35
# File 'lib/esearch/presenter/hit.rb', line 33

def fields
  raw['fields']
end

#sourceHash?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return source field if present

Returns:

  • (Hash)

    if present

  • (nil)

    otherwise



19
20
21
# File 'lib/esearch/presenter/hit.rb', line 19

def source
  raw['_source']
end