Class: Couchbase::SearchQuery::MatchPhraseQuery

Inherits:
Couchbase::SearchQuery show all
Defined in:
lib/couchbase/search_options.rb

Overview

The input text is analyzed and a phrase query is built with the terms resulting from the analysis.

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(match_phrase) {|self| ... } ⇒ MatchPhraseQuery

Returns a new instance of MatchPhraseQuery.

Parameters:

  • match_phrase (String)

Yield Parameters:



164
165
166
167
168
# File 'lib/couchbase/search_options.rb', line 164

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

Instance Attribute Details

#analyzerString

Returns:

  • (String)


159
160
161
# File 'lib/couchbase/search_options.rb', line 159

def analyzer
  @analyzer
end

#boostFloat

Returns:

  • (Float)


153
154
155
# File 'lib/couchbase/search_options.rb', line 153

def boost
  @boost
end

#fieldString

Returns:

  • (String)


156
157
158
# File 'lib/couchbase/search_options.rb', line 156

def field
  @field
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



171
172
173
174
175
176
177
# File 'lib/couchbase/search_options.rb', line 171

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