Class: Couchbase::SearchQuery::WildcardQuery
- Inherits:
-
Couchbase::SearchQuery
- Object
- Couchbase::SearchQuery
- Couchbase::SearchQuery::WildcardQuery
- 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
-
#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.
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
#boost ⇒ Float
261 262 263 |
# File 'lib/couchbase/search_options.rb', line 261 def boost @boost end |
#field ⇒ String
264 265 266 |
# File 'lib/couchbase/search_options.rb', line 264 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
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 |