Class: Couchbase::Cluster::SearchQuery::RegexpQuery

Inherits:
Couchbase::Cluster::SearchQuery show all
Defined in:
lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb
more...

Overview

Finds documents containing terms that match the specified regular expression.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Couchbase::Cluster::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, wildcard

Constructor Details

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

Returns a new instance of RegexpQuery.

Parameters:

  • regexp (String)

Yield Parameters:

[View source]

128
129
130
131
132
# File 'lib/couchbase/search_options.rb', line 128

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)

120
121
122
# File 'lib/couchbase/search_options.rb', line 120

def boost
  @boost
end

#fieldString

Returns:

  • (String)

123
124
125
# File 'lib/couchbase/search_options.rb', line 123

def field
  @field
end

Instance Method Details

#to_json(*args) ⇒ String

Returns:

  • (String)
[View source]

135
136
137
138
139
140
# File 'lib/couchbase/search_options.rb', line 135

def to_json(*args)
  data = {"regexp" => @regexp}
  data["boost"] = boost if boost
  data["field"] = field if field
  data.to_json(*args)
end