Class: Couchbase::SearchQuery::RegexpQuery
- Inherits:
-
Couchbase::SearchQuery
- Object
- Couchbase::SearchQuery
- Couchbase::SearchQuery::RegexpQuery
- Defined in:
- lib/couchbase/search_options.rb
Overview
Finds documents containing terms that match the specified regular expression.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(regexp) {|self| ... } ⇒ RegexpQuery
constructor
A new instance of RegexpQuery.
- #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(regexp) {|self| ... } ⇒ RegexpQuery
Returns a new instance of RegexpQuery.
201 202 203 204 205 |
# File 'lib/couchbase/search_options.rb', line 201 def initialize(regexp) super() @regexp = regexp yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
193 194 195 |
# File 'lib/couchbase/search_options.rb', line 193 def boost @boost end |
#field ⇒ String
196 197 198 |
# File 'lib/couchbase/search_options.rb', line 196 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
208 209 210 211 212 213 |
# File 'lib/couchbase/search_options.rb', line 208 def to_h data = {:regexp => @regexp} data[:boost] = boost if boost data[:field] = field if field data end |