Class: Couchbase::SearchQuery::WildcardQuery

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

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:



269
270
271
272
273
# File 'lib/couchbase/search_options.rb', line 269

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


261
262
263
# File 'lib/couchbase/search_options.rb', line 261

def boost
  @boost
end

#fieldString

Returns:

  • (String)


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

def field
  @field
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



276
277
278
279
280
281
# File 'lib/couchbase/search_options.rb', line 276

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