Class: Couchbase::Cluster::SearchQuery::PrefixQuery
Overview
The prefix query finds documents containing terms that start with the provided prefix. Usual better alternative is ‘MatchQuery`.
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, #to_json, wildcard
Constructor Details
#initialize(prefix) {|self| ... } ⇒ PrefixQuery
Returns a new instance of PrefixQuery.
[View source]
888
889
890
891
892
|
# File 'lib/couchbase/search_options.rb', line 888
def initialize(prefix)
super()
@prefix = prefix
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
877
878
879
|
# File 'lib/couchbase/search_options.rb', line 877
def boost
@boost
end
|
#field ⇒ String
883
884
885
|
# File 'lib/couchbase/search_options.rb', line 883
def field
@field
end
|
#operator ⇒ nil, ...
880
881
882
|
# File 'lib/couchbase/search_options.rb', line 880
def operator
@operator
end
|
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
[View source]
895
896
897
898
899
900
|
# File 'lib/couchbase/search_options.rb', line 895
def to_h
data = {:prefix => @prefix}
data[:boost] = boost if boost
data[:field] = field if field
data
end
|