Class: Couchbase::SearchQuery::MatchPhraseQuery

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

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

Constructor Details

#initialize(match_phrase) {|self| ... } ⇒ MatchPhraseQuery

Returns a new instance of MatchPhraseQuery.

Parameters:

  • match_phrase (String)

Yield Parameters:



162
163
164
165
166
# File 'lib/couchbase/search_options.rb', line 162

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

Instance Attribute Details

#analyzer ⇒ String

Returns:

  • (String)


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

def analyzer
  @analyzer
end

#boost ⇒ Float

Returns:

  • (Float)


151
152
153
# File 'lib/couchbase/search_options.rb', line 151

def boost
  @boost
end

#field ⇒ String

Returns:

  • (String)


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

def field
  @field
end

Instance Method Details

#to_h ⇒ Hash<Symbol, #to_json>

Returns:



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

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