Class: Arelastic::Builders::Queries
- Inherits:
-
Struct
- Object
- Struct
- Arelastic::Builders::Queries
- Defined in:
- lib/arelastic/builders/queries.rb
Constant Summary collapse
- MACROS_TO_ARELASTIC =
{ bool: Arelastic::Queries::Bool, constant_score: Arelastic::Queries::ConstantScore, dis_max: Arelastic::Queries::DisMax, exists: Arelastic::Queries::Exists, field: Arelastic::Queries::Field, filter: Arelastic::Queries::Filter, function_score: Arelastic::Queries::FunctionScore, fuzzy: Arelastic::Queries::Fuzzy, geo_bounding_box: Arelastic::Queries::GeoBoundingBox, geo_distance: Arelastic::Queries::GeoDistance, geo_polygon: Arelastic::Queries::GeoPolygon, has_child: Arelastic::Queries::HasChild, has_parent: Arelastic::Queries::HasParent, ids: Arelastic::Queries::Ids, limit: Arelastic::Queries::Limit, match: Arelastic::Queries::Match, match_all: Arelastic::Queries::MatchAll, match_none: Arelastic::Queries::MatchNone, match_phrase: Arelastic::Queries::MatchPhrase, multi_match: Arelastic::Queries::MultiMatch, nested: Arelastic::Queries::Nested, percolate: Arelastic::Queries::Percolate, prefix: Arelastic::Queries::Prefix, query: Arelastic::Queries::Query, query_string: Arelastic::Queries::QueryString, range: Arelastic::Queries::Range, regexp: Arelastic::Queries::Regexp, script: Arelastic::Queries::Script, simple_query_string: Arelastic::Queries::SimpleQueryString, term: Arelastic::Queries::Term, terms: Arelastic::Queries::Terms, wildcard: Arelastic::Queries::Wildcard }
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #gt(other) ⇒ Object
- #gte(other) ⇒ Object
- #in(other, options = {}) ⇒ Object
- #lt(other) ⇒ Object
- #lte(other) ⇒ Object
- #missing(options = {}) ⇒ Object
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
3 4 5 |
# File 'lib/arelastic/builders/queries.rb', line 3 def name @name end |
Class Method Details
.[](field) ⇒ Object
40 41 42 |
# File 'lib/arelastic/builders/queries.rb', line 40 def [](field) new(field) end |
Instance Method Details
#gt(other) ⇒ Object
78 79 80 |
# File 'lib/arelastic/builders/queries.rb', line 78 def gt other range 'gt' => other end |
#gte(other) ⇒ Object
74 75 76 |
# File 'lib/arelastic/builders/queries.rb', line 74 def gte other range 'gte' => other end |
#in(other, options = {}) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/arelastic/builders/queries.rb', line 57 def in other, = {} case other when Range if other.exclude_end? range 'gte' => other.begin, 'lt' => other.end else range 'gte' => other.begin, 'lte' => other.end end else terms other, end end |
#lt(other) ⇒ Object
86 87 88 |
# File 'lib/arelastic/builders/queries.rb', line 86 def lt other range 'lt' => other end |
#lte(other) ⇒ Object
82 83 84 |
# File 'lib/arelastic/builders/queries.rb', line 82 def lte other range 'lte' => other end |
#missing(options = {}) ⇒ Object
70 71 72 |
# File 'lib/arelastic/builders/queries.rb', line 70 def missing( = {}) exists().negate end |