Class: Couchbase::SearchQuery::RegexpQuery

Inherits:
SearchQuery
  • Object
show all
Defined in:
lib/couchbase/search_options.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/lib/couchbase/search_options.rb

Overview

Finds documents containing terms that match the specified regular expression.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp) {|self| ... } ⇒ RegexpQuery

Returns a new instance of RegexpQuery.

Parameters:

  • regexp (String)

Yield Parameters:



199
200
201
202
203
# File 'lib/couchbase/search_options.rb', line 199

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

Instance Attribute Details

#boost ⇒ Float

Returns:

  • (Float)


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

def boost
  @boost
end

#field ⇒ String

Returns:

  • (String)


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

def field
  @field
end

Instance Method Details

#to_h ⇒ Hash<Symbol, #to_json>

Returns:



206
207
208
209
210
211
# File 'lib/couchbase/search_options.rb', line 206

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