Class: Couchbase::Cluster::SearchQuery::PhraseQuery
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
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, wildcard
Constructor Details
#initialize(*terms) {|self| ... } ⇒ PhraseQuery
Returns a new instance of PhraseQuery.
[View source]
988
989
990
991
992
|
# File 'lib/couchbase/search_options.rb', line 988
def initialize(*terms)
super()
@terms = terms.flatten
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
977
978
979
|
# File 'lib/couchbase/search_options.rb', line 977
def boost
@boost
end
|
#field ⇒ String
983
984
985
|
# File 'lib/couchbase/search_options.rb', line 983
def field
@field
end
|
#operator ⇒ nil, ...
980
981
982
|
# File 'lib/couchbase/search_options.rb', line 980
def operator
@operator
end
|
Instance Method Details
#to_json(*args) ⇒ String
[View source]
995
996
997
998
999
1000
1001
|
# File 'lib/couchbase/search_options.rb', line 995
def to_json(*args)
data = {"terms" => @terms.flatten.uniq}
data["boost"] = boost if boost
data["operator"] = operator.to_s if operator
data["field"] = field if field
data.to_json(*args)
end
|