Class: Couchbase::SearchQuery::MatchQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::MatchQuery
- Defined in:
- lib/couchbase/search_options.rb
Overview
A match query analyzes the input text and uses that analyzed text to query the index.
Instance Attribute Summary collapse
- #analyzer ⇒ String
- #boost ⇒ Float
- #field ⇒ String
- #fuzziness ⇒ Integer
- #operator ⇒ nil, ...
- #prefix_length ⇒ Integer
Instance Method Summary collapse
-
#initialize(match) {|self| ... } ⇒ MatchQuery
constructor
A new instance of MatchQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Constructor Details
#initialize(match) {|self| ... } ⇒ MatchQuery
Returns a new instance of MatchQuery.
123 124 125 126 127 |
# File 'lib/couchbase/search_options.rb', line 123 def initialize(match) super() @match = match yield self if block_given? end |
Instance Attribute Details
#analyzer ⇒ String
110 111 112 |
# File 'lib/couchbase/search_options.rb', line 110 def analyzer @analyzer end |
#boost ⇒ Float
104 105 106 |
# File 'lib/couchbase/search_options.rb', line 104 def boost @boost end |
#field ⇒ String
107 108 109 |
# File 'lib/couchbase/search_options.rb', line 107 def field @field end |
#fuzziness ⇒ Integer
116 117 118 |
# File 'lib/couchbase/search_options.rb', line 116 def fuzziness @fuzziness end |
#operator ⇒ nil, ...
119 120 121 |
# File 'lib/couchbase/search_options.rb', line 119 def operator @operator end |
#prefix_length ⇒ Integer
113 114 115 |
# File 'lib/couchbase/search_options.rb', line 113 def prefix_length @prefix_length end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/couchbase/search_options.rb', line 130 def to_h data = {:match => @match} data[:boost] = boost if boost data[:field] = field if field data[:analyzer] = analyzer if analyzer data[:operator] = operator if operator data[:fuzziness] = fuzziness if fuzziness data[:prefix_length] = prefix_length if prefix_length data end |