Class: Couchbase::Cluster::SearchQuery::PrefixQuery
- Inherits:
-
Couchbase::Cluster::SearchQuery
- Object
- Couchbase::Cluster::SearchQuery
- Couchbase::Cluster::SearchQuery::PrefixQuery
- Defined in:
- lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb more...
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
-
#initialize(prefix) {|self| ... } ⇒ PrefixQuery
constructor
A new instance of PrefixQuery.
- #to_json(*args) ⇒ String
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, wildcard
Constructor Details
#initialize(prefix) {|self| ... } ⇒ PrefixQuery
Returns a new instance of PrefixQuery.
876 877 878 879 880 |
# File 'lib/couchbase/search_options.rb', line 876 def initialize(prefix) super() @prefix = prefix yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
868 869 870 |
# File 'lib/couchbase/search_options.rb', line 868 def boost @boost end |
#field ⇒ String
871 872 873 |
# File 'lib/couchbase/search_options.rb', line 871 def field @field end |
Instance Method Details
#to_json(*args) ⇒ String
883 884 885 886 887 888 |
# File 'lib/couchbase/search_options.rb', line 883 def to_json(*args) data = {"prefix" => @prefix} data["boost"] = boost if boost data["field"] = field if field data.to_json(*args) end |