Class: ElasticRecord::Doctype
- Inherits:
-
Object
- Object
- ElasticRecord::Doctype
- Defined in:
- lib/elastic_record/doctype.rb
Constant Summary collapse
- DEFAULT_MAPPING =
{ properties: { }, _all: { enabled: false } }
- PERCOLATOR_MAPPING =
{ properties: { query: { type: "percolator" } } }
Instance Attribute Summary collapse
-
#analysis ⇒ Object
Returns the value of attribute analysis.
-
#mapping ⇒ Object
Returns the value of attribute mapping.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, mapping = DEFAULT_MAPPING.deep_dup) ⇒ Doctype
constructor
A new instance of Doctype.
Constructor Details
#initialize(name, mapping = DEFAULT_MAPPING.deep_dup) ⇒ Doctype
Returns a new instance of Doctype.
25 26 27 28 29 |
# File 'lib/elastic_record/doctype.rb', line 25 def initialize(name, mapping = DEFAULT_MAPPING.deep_dup) @name = name @mapping = mapping @analysis = {} end |
Instance Attribute Details
#analysis ⇒ Object
Returns the value of attribute analysis.
3 4 5 |
# File 'lib/elastic_record/doctype.rb', line 3 def analysis @analysis end |
#mapping ⇒ Object
Returns the value of attribute mapping.
3 4 5 |
# File 'lib/elastic_record/doctype.rb', line 3 def mapping @mapping end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/elastic_record/doctype.rb', line 3 def name @name end |
Class Method Details
.percolator_doctype ⇒ Object
21 22 23 |
# File 'lib/elastic_record/doctype.rb', line 21 def self.percolator_doctype new('queries', PERCOLATOR_MAPPING) end |
Instance Method Details
#==(other) ⇒ Object
39 40 41 |
# File 'lib/elastic_record/doctype.rb', line 39 def ==(other) name == other.name && mapping == other.mapping && analysis == other.analysis end |