Class: Couchbase::Cluster::SearchQuery::QueryStringQuery

Inherits:
Couchbase::Cluster::SearchQuery show all
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

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.

Parameters:

  • query_string (String)

Yield Parameters:

[View source]

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

#boostFloat

Returns:

  • (Float)

156
157
158
# File 'lib/couchbase/search_options.rb', line 156

def boost
  @boost
end

Instance Method Details

#to_json(*args) ⇒ String

Returns:

  • (String)
[View source]

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