Class: Couchbase::SearchQuery::RegexpQuery

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

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.

Parameters:

  • regexp (String)

Yield Parameters:



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

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


195
196
197
# File 'lib/couchbase/search_options.rb', line 195

def boost
  @boost
end

#fieldString

Returns:

  • (String)


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

def field
  @field
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



210
211
212
213
214
215
# File 'lib/couchbase/search_options.rb', line 210

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