Class: Couchbase::SearchQuery::PrefixQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::PrefixQuery
- Defined in:
- lib/couchbase/search_options.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/lib/couchbase/search_options.rb
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_h ⇒ Hash<Symbol, #to_json>
Constructor Details
#initialize(prefix) {|self| ... } ⇒ PrefixQuery
Returns a new instance of PrefixQuery.
947 948 949 950 951 |
# File 'lib/couchbase/search_options.rb', line 947 def initialize(prefix) super() @prefix = prefix yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
936 937 938 |
# File 'lib/couchbase/search_options.rb', line 936 def boost @boost end |
#field ⇒ String
942 943 944 |
# File 'lib/couchbase/search_options.rb', line 942 def field @field end |
#operator ⇒ nil, ...
939 940 941 |
# File 'lib/couchbase/search_options.rb', line 939 def operator @operator end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
954 955 956 957 958 959 |
# File 'lib/couchbase/search_options.rb', line 954 def to_h data = {:prefix => @prefix} data[:boost] = boost if boost data[:field] = field if field data end |