Class: Couchbase::SearchQuery::WildcardQuery
- Inherits:
-
Couchbase::SearchQuery
- Object
- Couchbase::SearchQuery
- Couchbase::SearchQuery::WildcardQuery
- 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
-
#initialize(wildcard) {|self| ... } ⇒ WildcardQuery
constructor
A new instance of WildcardQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
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.
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
#boost ⇒ Float
263 264 265 |
# File 'lib/couchbase/search_options.rb', line 263 def boost @boost end |
#field ⇒ String
266 267 268 |
# File 'lib/couchbase/search_options.rb', line 266 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
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 |