Class: Couchbase::Options::Search
- Defined in:
- lib/couchbase/options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/options.rb more...
Overview
Options for Cluster#search_query
Instance Attribute Summary collapse
- #disable_scoring ⇒ Boolean
- #explain ⇒ Boolean
- #facets ⇒ Hash<String => Cluster::SearchFacet>
- #fields ⇒ Array<String>
- #highlight_fields ⇒ Array<String>
- #highlight_style ⇒ Symbol
- #limit ⇒ Integer
-
#scan_consistency ⇒ void
writeonly
Customizes the consistency guarantees for this query.
- #skip ⇒ Integer
- #sort ⇒ Array<String, Cluster::SearchSort>
- #transcoder ⇒ JsonTranscoder, #decode(String)
Attributes inherited from Base
#client_context, #parent_span, #retry_strategy, #timeout
Instance Method Summary collapse
-
#consistent_with(mutation_state) ⇒ void
Sets the mutation tokens this query should be consistent with.
-
#initialize(limit: nil, skip: nil, explain: false, highlight_style: nil, highlight_fields: nil, fields: nil, mutation_state: nil, disable_scoring: false, sort: nil, facets: nil, transcoder: JsonTranscoder.new, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(limit: nil, skip: nil, explain: false, highlight_style: nil, highlight_fields: nil, fields: nil, mutation_state: nil, disable_scoring: false, sort: nil, facets: nil, transcoder: JsonTranscoder.new, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Search
Returns a new instance of Search.
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 |
# File 'lib/couchbase/options.rb', line 1560 def initialize(limit: nil, skip: nil, explain: false, highlight_style: nil, highlight_fields: nil, fields: nil, mutation_state: nil, disable_scoring: false, sort: nil, facets: nil, transcoder: JsonTranscoder.new, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span) @limit = limit @skip = skip @explain = explain @highlight_style = highlight_style @highlight_fields = highlight_fields @fields = fields @disable_scoring = disable_scoring @sort = sort @facets = facets @transcoder = transcoder @scan_consistency = :not_bounded @mutation_state = mutation_state yield self if block_given? end |
Instance Attribute Details
#disable_scoring ⇒ Boolean
1529 1530 1531 |
# File 'lib/couchbase/options.rb', line 1529 def disable_scoring @disable_scoring end |
#explain ⇒ Boolean
1525 1526 1527 |
# File 'lib/couchbase/options.rb', line 1525 def explain @explain end |
#facets ⇒ Hash<String => Cluster::SearchFacet>
1531 1532 1533 |
# File 'lib/couchbase/options.rb', line 1531 def facets @facets end |
#fields ⇒ Array<String>
1528 1529 1530 |
# File 'lib/couchbase/options.rb', line 1528 def fields @fields end |
#highlight_fields ⇒ Array<String>
1527 1528 1529 |
# File 'lib/couchbase/options.rb', line 1527 def highlight_fields @highlight_fields end |
#highlight_style ⇒ Symbol
1526 1527 1528 |
# File 'lib/couchbase/options.rb', line 1526 def highlight_style @highlight_style end |
#limit ⇒ Integer
1523 1524 1525 |
# File 'lib/couchbase/options.rb', line 1523 def limit @limit end |
#scan_consistency=(level) ⇒ void
Note:
overrides consistency level set by #consistent_with
This method returns an undefined value.
Customizes the consistency guarantees for this query
1611 1612 1613 1614 |
# File 'lib/couchbase/options.rb', line 1611 def scan_consistency=(level) @mutation_state = nil if @mutation_state @scan_consistency = level end |
#skip ⇒ Integer
1524 1525 1526 |
# File 'lib/couchbase/options.rb', line 1524 def skip @skip end |
#sort ⇒ Array<String, Cluster::SearchSort>
1530 1531 1532 |
# File 'lib/couchbase/options.rb', line 1530 def sort @sort end |
#transcoder ⇒ JsonTranscoder, #decode(String)
1532 1533 1534 |
# File 'lib/couchbase/options.rb', line 1532 def transcoder @transcoder end |
Instance Method Details
#consistent_with(mutation_state) ⇒ void
Note:
overrides consistency level set by #scan_consistency=
This method returns an undefined value.
Sets the mutation tokens this query should be consistent with
1598 1599 1600 1601 |
# File 'lib/couchbase/options.rb', line 1598 def consistent_with(mutation_state) @scan_consistency = nil if @scan_consistency @mutation_state = mutation_state end |