Class: Couchbase::Cluster::SearchQuery::PhraseQuery
- Inherits:
-
Couchbase::Cluster::SearchQuery
- Object
- Couchbase::Cluster::SearchQuery
- Couchbase::Cluster::SearchQuery::PhraseQuery
- Defined in:
- lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb more...
Overview
A query that looks for exact match of several terms (in the exact order) in the index. Usual better alternative is MatchPhraseQuery.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(*terms) {|self| ... } ⇒ PhraseQuery
constructor
A new instance of PhraseQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Methods inherited from Couchbase::Cluster::SearchQuery
boolean_field, booleans, conjuncts, date_range, disjuncts, doc_id, geo_bounding_box, geo_distance, geo_polygon, match, match_all, match_none, match_phrase, numeric_range, phrase, prefix, query_string, regexp, term, term_range, #to_json, wildcard
Constructor Details
#initialize(*terms) {|self| ... } ⇒ PhraseQuery
Returns a new instance of PhraseQuery.
924 925 926 927 928 |
# File 'lib/couchbase/search_options.rb', line 924 def initialize(*terms) super() @terms = terms.flatten yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
916 917 918 |
# File 'lib/couchbase/search_options.rb', line 916 def boost @boost end |
#field ⇒ String
919 920 921 |
# File 'lib/couchbase/search_options.rb', line 919 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
931 932 933 934 935 936 |
# File 'lib/couchbase/search_options.rb', line 931 def to_h data = {:terms => @terms.flatten.uniq} data[:boost] = boost if boost data[:field] = field if field data end |