Class: Couchbase::SearchQuery::WildcardQuery

Inherits:
SearchQuery
  • Object
show all
Defined in:
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

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