Class: Couchbase::SearchQuery::QueryStringQuery

Inherits:
Couchbase::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::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, #to_json, wildcard

Constructor Details

#initialize(query_string) {|self| ... } ⇒ QueryStringQuery

Returns a new instance of QueryStringQuery.

Parameters:

  • query_string (String)

Yield Parameters:



236
237
238
239
240
# File 'lib/couchbase/search_options.rb', line 236

def initialize(query_string)
  super()
  @query_string = query_string
  yield self if block_given?
end

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


231
232
233
# File 'lib/couchbase/search_options.rb', line 231

def boost
  @boost
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



243
244
245
246
247
# File 'lib/couchbase/search_options.rb', line 243

def to_h
  data = {:query => @query_string}
  data[:boost] = boost if boost
  data
end