Class: Couchbase::Cluster::SearchOptions
- Inherits:
-
Object
- Object
- Couchbase::Cluster::SearchOptions
- Defined in:
- lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb more...
Instance Attribute Summary collapse
-
#disable_scoring ⇒ Boolean
If set to true, the server will not perform any scoring on the hits.
-
#explain ⇒ Boolean
Triggers inclusion of additional search result score explanations.
-
#facets ⇒ Hash<String => SearchFacet>
Facets allow to aggregate information collected on a particular result set.
-
#fields ⇒ Array<String>
List of field values which should be retrieved for result documents, provided they were stored while indexing.
-
#highlight_fields ⇒ Array<String>
List of the fields to highlight.
-
#highlight_style ⇒ :html, :ansi
The style of highlighting in the result excerpts (if not specified, the server default will be used).
-
#limit ⇒ Integer
Limits the number of matches returned from the complete result set.
-
#scan_consistency ⇒ :not_bounded
Specifies level of consistency for the query.
-
#skip ⇒ Integer
Indicates how many matches are skipped on the result set before starting to return the matches.
-
#sort ⇒ Array<String, SearchSort>
Ordering rules to apply to the results.
-
#timeout ⇒ Integer
Timeout in milliseconds.
-
#transcoder ⇒ JsonTranscoder
Transcoder to use for the results.
Instance Method Summary collapse
-
#consistent_with(mutation_state) ⇒ void
Sets the mutation tokens this query should be consistent with.
-
#initialize {|self| ... } ⇒ SearchOptions
constructor
A new instance of SearchOptions.
Constructor Details
#initialize {|self| ... } ⇒ SearchOptions
Returns a new instance of SearchOptions.
1291 1292 1293 1294 1295 1296 1297 1298 1299 |
# File 'lib/couchbase/search_options.rb', line 1291 def initialize super @disable_scoring = false @explain = false @transcoder = JsonTranscoder.new @scan_consistency = nil @mutation_state = nil yield self if block_given? end |
Instance Attribute Details
#disable_scoring ⇒ Boolean
If set to true, the server will not perform any scoring on the hits
1242 1243 1244 |
# File 'lib/couchbase/search_options.rb', line 1242 def disable_scoring @disable_scoring end |
#explain ⇒ Boolean
Returns triggers inclusion of additional search result score explanations. (Default: false
).
1220 1221 1222 |
# File 'lib/couchbase/search_options.rb', line 1220 def explain @explain end |
#facets ⇒ Hash<String => SearchFacet>
Facets allow to aggregate information collected on a particular result set
1285 1286 1287 |
# File 'lib/couchbase/search_options.rb', line 1285 def facets @facets end |
#fields ⇒ Array<String>
Returns list of field values which should be retrieved for result documents, provided they were stored while indexing.
1230 1231 1232 |
# File 'lib/couchbase/search_options.rb', line 1230 def fields @fields end |
#highlight_fields ⇒ Array<String>
Returns list of the fields to highlight.
1226 1227 1228 |
# File 'lib/couchbase/search_options.rb', line 1226 def highlight_fields @highlight_fields end |
#highlight_style ⇒ :html, :ansi
Returns the style of highlighting in the result excerpts (if not specified, the server default will be used).
1223 1224 1225 |
# File 'lib/couchbase/search_options.rb', line 1223 def highlight_style @highlight_style end |
#limit ⇒ Integer
Returns limits the number of matches returned from the complete result set.
1214 1215 1216 |
# File 'lib/couchbase/search_options.rb', line 1214 def limit @limit end |
#scan_consistency ⇒ :not_bounded
Returns specifies level of consistency for the query.
1233 1234 1235 |
# File 'lib/couchbase/search_options.rb', line 1233 def scan_consistency @scan_consistency end |
#skip ⇒ Integer
Returns indicates how many matches are skipped on the result set before starting to return the matches.
1217 1218 1219 |
# File 'lib/couchbase/search_options.rb', line 1217 def skip @skip end |
#sort ⇒ Array<String, SearchSort>
Ordering rules to apply to the results
The list might contain either strings or special objects, that derive from Couchbase::Cluster::SearchSort.
In case of String, the value represents the name of the field with optional -
in front of the name, which will turn on descending mode for this field. One field is special is “_score” which will sort results by their score.
When nothing specified, the Server will order results by their score descending, which is equivalent of “-_score”.
1280 1281 1282 |
# File 'lib/couchbase/search_options.rb', line 1280 def sort @sort end |
#timeout ⇒ Integer
Returns Timeout in milliseconds.
1211 1212 1213 |
# File 'lib/couchbase/search_options.rb', line 1211 def timeout @timeout end |
#transcoder ⇒ JsonTranscoder
Returns transcoder to use for the results.
1288 1289 1290 |
# File 'lib/couchbase/search_options.rb', line 1288 def transcoder @transcoder end |
Instance Method Details
#consistent_with(mutation_state) ⇒ void
overrides consistency level set by #scan_consistency=
This method returns an undefined value.
Sets the mutation tokens this query should be consistent with
1265 1266 1267 1268 |
# File 'lib/couchbase/search_options.rb', line 1265 def consistent_with(mutation_state) @scan_consistency = nil if @scan_consistency @mutation_state = mutation_state end |