Class: Couchbase::Cluster::SearchQuery::WildcardQuery

Inherits:
Couchbase::Cluster::SearchQuery show all
Defined in:
lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb
more...

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::Cluster::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, wildcard

Constructor Details

#initialize(wildcard) {|self| ... } ⇒ WildcardQuery

Returns a new instance of WildcardQuery.

Parameters:

  • wildcard (String)

Yield Parameters:

[View source]

196
197
198
199
200
# File 'lib/couchbase/search_options.rb', line 196

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)

188
189
190
# File 'lib/couchbase/search_options.rb', line 188

def boost
  @boost
end

#fieldString

Returns:

  • (String)

191
192
193
# File 'lib/couchbase/search_options.rb', line 191

def field
  @field
end

Instance Method Details

#to_json(*args) ⇒ String

Returns:

  • (String)
[View source]

203
204
205
206
207
208
# File 'lib/couchbase/search_options.rb', line 203

def to_json(*args)
  data = {"wildcard" => @wildcard}
  data["boost"] = boost if boost
  data["field"] = field if field
  data.to_json(*args)
end