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
- #collections ⇒ Array<String>?
- #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, collections: nil, 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, collections: nil, 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.
1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 |
# File 'lib/couchbase/options.rb', line 1664 def initialize(limit: nil, skip: nil, explain: false, highlight_style: nil, highlight_fields: nil, fields: nil, mutation_state: nil, disable_scoring: false, collections: nil, 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 @collections = collections @sort = sort @facets = facets @transcoder = transcoder @scan_consistency = :not_bounded @mutation_state = mutation_state yield self if block_given? end |
Instance Attribute Details
#collections ⇒ Array<String>?
1632 1633 1634 |
# File 'lib/couchbase/options.rb', line 1632 def collections @collections end |
#disable_scoring ⇒ Boolean
1631 1632 1633 |
# File 'lib/couchbase/options.rb', line 1631 def disable_scoring @disable_scoring end |
#explain ⇒ Boolean
1627 1628 1629 |
# File 'lib/couchbase/options.rb', line 1627 def explain @explain end |
#facets ⇒ Hash<String => Cluster::SearchFacet>
1634 1635 1636 |
# File 'lib/couchbase/options.rb', line 1634 def facets @facets end |
#fields ⇒ Array<String>
1630 1631 1632 |
# File 'lib/couchbase/options.rb', line 1630 def fields @fields end |
#highlight_fields ⇒ Array<String>
1629 1630 1631 |
# File 'lib/couchbase/options.rb', line 1629 def highlight_fields @highlight_fields end |
#highlight_style ⇒ Symbol
1628 1629 1630 |
# File 'lib/couchbase/options.rb', line 1628 def highlight_style @highlight_style end |
#limit ⇒ Integer
1625 1626 1627 |
# File 'lib/couchbase/options.rb', line 1625 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
1717 1718 1719 1720 |
# File 'lib/couchbase/options.rb', line 1717 def scan_consistency=(level) @mutation_state = nil if @mutation_state @scan_consistency = level end |
#skip ⇒ Integer
1626 1627 1628 |
# File 'lib/couchbase/options.rb', line 1626 def skip @skip end |
#sort ⇒ Array<String, Cluster::SearchSort>
1633 1634 1635 |
# File 'lib/couchbase/options.rb', line 1633 def sort @sort end |
#transcoder ⇒ JsonTranscoder, #decode(String)
1635 1636 1637 |
# File 'lib/couchbase/options.rb', line 1635 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
1704 1705 1706 1707 |
# File 'lib/couchbase/options.rb', line 1704 def consistent_with(mutation_state) @scan_consistency = nil if @scan_consistency @mutation_state = mutation_state end |