Class: Couchbase::Cluster::SearchQuery::QueryStringQuery
- Inherits:
-
Couchbase::Cluster::SearchQuery
- Object
- Couchbase::Cluster::SearchQuery
- Couchbase::Cluster::SearchQuery::QueryStringQuery
- Defined in:
- lib/couchbase/search_options.rb
Overview
The query string query allows humans to describe complex queries using a simple syntax.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(query_string) {|self| ... } ⇒ QueryStringQuery
constructor
A new instance of QueryStringQuery.
- #to_json(*args) ⇒ String
Methods inherited from Couchbase::Cluster::SearchQuery
boolean_field, booleans, conjuncts, date_range, disjuncts, doc_id, geo_bounding_box, geo_distance, match, match_all, match_none, match_phrase, numeric_range, phrase, prefix, query_string, regexp, term, term_range, wildcard
Constructor Details
#initialize(query_string) {|self| ... } ⇒ QueryStringQuery
Returns a new instance of QueryStringQuery.
161 162 163 164 165 |
# File 'lib/couchbase/search_options.rb', line 161 def initialize(query_string) super() @query_string = query_string yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
156 157 158 |
# File 'lib/couchbase/search_options.rb', line 156 def boost @boost end |
Instance Method Details
#to_json(*args) ⇒ String
168 169 170 171 172 |
# File 'lib/couchbase/search_options.rb', line 168 def to_json(*args) data = {"query" => @query_string} data["boost"] = boost if boost data.to_json(*args) end |