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:



234
235
236
237
238
# File 'lib/couchbase/search_options.rb', line 234

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


229
230
231
# File 'lib/couchbase/search_options.rb', line 229

def boost
  @boost
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



241
242
243
244
245
# File 'lib/couchbase/search_options.rb', line 241

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