Class: Couchbase::Cluster::SearchQuery::MatchPhraseQuery

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

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

Returns a new instance of MatchPhraseQuery.

Parameters:

  • match_phrase (String)

Yield Parameters:



91
92
93
94
95
# File 'lib/couchbase/search_options.rb', line 91

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

Instance Attribute Details

#analyzerString

Returns:

  • (String)


86
87
88
# File 'lib/couchbase/search_options.rb', line 86

def analyzer
  @analyzer
end

#boostFloat

Returns:

  • (Float)


80
81
82
# File 'lib/couchbase/search_options.rb', line 80

def boost
  @boost
end

#fieldString

Returns:

  • (String)


83
84
85
# File 'lib/couchbase/search_options.rb', line 83

def field
  @field
end

Instance Method Details

#to_json(*args) ⇒ String

Returns:

  • (String)


98
99
100
101
102
103
104
# File 'lib/couchbase/search_options.rb', line 98

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