Class: Couchbase::SearchQuery::WildcardQuery

Inherits:
Couchbase::SearchQuery show all
Defined in:
lib/couchbase/search_options.rb,
/code/couchbase-ruby-client/lib/couchbase/search_options.rb

Overview

Interprets * and ? wildcards as found in a lot of applications, for an easy implementation of such a search feature.

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(wildcard) {|self| ... } ⇒ WildcardQuery

Returns a new instance of WildcardQuery.

Parameters:

  • wildcard (String)

Yield Parameters:



271
272
273
274
275
# File 'lib/couchbase/search_options.rb', line 271

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


263
264
265
# File 'lib/couchbase/search_options.rb', line 263

def boost
  @boost
end

#fieldString

Returns:

  • (String)


266
267
268
# File 'lib/couchbase/search_options.rb', line 266

def field
  @field
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



278
279
280
281
282
283
# File 'lib/couchbase/search_options.rb', line 278

def to_h
  data = {:wildcard => @wildcard}
  data[:boost] = boost if boost
  data[:field] = field if field
  data
end