Packages

case class SearchOptions(limit: Option[Int] = None, skip: Option[Int] = None, explain: Option[Boolean] = None, highlightStyle: Option[HighlightStyle] = None, highlightFields: Option[Seq[String]] = None, fields: Option[Seq[String]] = None, collections: Option[Seq[String]] = None, sort: Option[Seq[SearchSort]] = None, facets: Option[Map[String, SearchFacet]] = None, serverSideTimeout: Option[Duration] = None, deferredError: Option[RuntimeException] = None, scanConsistency: Option[SearchScanConsistency] = None, timeout: Option[Duration] = None, retryStrategy: Option[RetryStrategy] = None, parentSpan: Option[RequestSpan] = None, raw: Option[Map[String, Any]] = None, disableScoring: Boolean = false, includeLocations: Boolean = false) extends Product with Serializable

Options to be used with a Full Text Search query.

Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SearchOptions
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new SearchOptions(limit: Option[Int] = None, skip: Option[Int] = None, explain: Option[Boolean] = None, highlightStyle: Option[HighlightStyle] = None, highlightFields: Option[Seq[String]] = None, fields: Option[Seq[String]] = None, collections: Option[Seq[String]] = None, sort: Option[Seq[SearchSort]] = None, facets: Option[Map[String, SearchFacet]] = None, serverSideTimeout: Option[Duration] = None, deferredError: Option[RuntimeException] = None, scanConsistency: Option[SearchScanConsistency] = None, timeout: Option[Duration] = None, retryStrategy: Option[RetryStrategy] = None, parentSpan: Option[RequestSpan] = None, raw: Option[Map[String, Any]] = None, disableScoring: Boolean = false, includeLocations: Boolean = false)

Value Members

  1. def collections(collectionNames: Seq[String]): SearchOptions

    Allows to limit the search query to a specific list of collection names.

    Allows to limit the search query to a specific list of collection names.

    NOTE: this is only supported with server 7.0 and later.

    collectionNames

    the names of the collections this query should be limited to.

    returns

    this SearchOptions for chaining.

  2. def disableScoring(value: Boolean): SearchOptions

    If set to true, the server will not perform any scoring on the hits.

    If set to true, the server will not perform any scoring on the hits.

    This could provide a performance improvement in cases where the score is not required.

    This parameter only has an effect if the Couchbase Cluster version is 6.6.0 or above.

    returns

    a copy of this with the change applied, for chaining.

  3. def explain(value: Boolean): SearchOptions

    Activates the explanation of each result hit in the response.

    Activates the explanation of each result hit in the response. The default is false.

    returns

    this SearchOptions for chaining.

  4. def facets(facets: Map[String, SearchFacet]): SearchOptions

    Sets the search facets, which allow aggregating information collected on a particular result-set.

    Sets the search facets, which allow aggregating information collected on a particular result-set.

    facets

    the facets to use

    returns

    this SearchOptions for chaining.

  5. def fields(fields: Seq[String]): SearchOptions

    Configures the list of fields for which the whole value should be included in the response.

    Configures the list of fields for which the whole value should be included in the response. If empty, no field values are included.

    This drives the inclusion of the com.couchbase.client.scala.search.result.SearchRow.fieldsAs fields in each SearchRow hit.

    Note that to be highlighted, the fields must be stored in the FTS index.

    returns

    this SearchOptions for chaining.

  6. def highlight(style: Option[HighlightStyle], fields: Option[Seq[String]]): SearchOptions

    Configures the highlighting of matches in the response.

    Configures the highlighting of matches in the response.

    Highlighting is disabled by default.

    This drives the inclusion of the fragments in each com.couchbase.client.scala.search.result.SearchRow row.

    Note that to be highlighted, the fields must be stored in the FTS index.

    Both style and fields are optional.

    style

    the HighlightStyle to apply.

    fields

    the optional fields on which to highlight. If none, all fields where there is a match are highlighted.

    returns

    this SearchOptions for chaining.

  7. def includeLocations(value: Boolean): SearchOptions

    If set to true, will include the location in the search rows.

    If set to true, will include the location in the search rows.

    value

    set to true if the locations should be included.

    returns

    a copy of this with the change applied, for chaining.

  8. def limit(limit: Int): SearchOptions

    Add a limit to the query on the number of rows it can return.

    Add a limit to the query on the number of rows it can return.

    If not set, the default is 10.

    limit

    the maximum number of rows to return.

    returns

    this SearchOptions for chaining.

  9. def parentSpan(value: RequestSpan): SearchOptions

    Sets the parent RequestSpan.

    Sets the parent RequestSpan.

    returns

    a copy of this with the change applied, for chaining.

  10. def productElementNames: Iterator[String]
    Definition Classes
    Product
  11. def raw(raw: Map[String, Any]): SearchOptions

    Allows providing custom JSON key/value pairs for advanced usage.

    Allows providing custom JSON key/value pairs for advanced usage.

    If available, it is recommended to use the methods on this object to customize the query. This method should only be used if no such setter can be found (i.e. if an undocumented property should be set or you are using an older client and a new server-configuration property has been added to the cluster).

    Note that the values will be passed through a JSON encoder, so do not provide already encoded JSON as the value. If you want to pass objects or arrays, you can use JsonObject and JsonArray respectively.

    returns

    a copy of this with the change applied, for chaining.

  12. def scanConsistency(scanConsistency: SearchScanConsistency): SearchOptions

    Sets the consistency to consider for this FTS query.

    Sets the consistency to consider for this FTS query. See SearchScanConsistency for documentation.

    returns

    this SearchOptions for chaining.

  13. def skip(skip: Int): SearchOptions

    Set the number of rows to skip (eg.

    Set the number of rows to skip (eg. for pagination).

    If not set, the default is 0.

    skip

    the number of results to skip.

    returns

    this SearchOptions for chaining.

  14. def sort(fields: Seq[SearchSort]): SearchOptions

    Configures the list of fields (including special fields) which are used for sorting purposes.

    Configures the list of fields (including special fields) which are used for sorting purposes. If empty, the default sorting (descending by score) is used by the server.

    See com.couchbase.client.scala.search.sort.SearchSort for the various sorting options.

    If no sort is provided, it is equal to sort(Seq("-_score")), since the server will sort it by score in descending order.

    fields

    the fields that should take part in the sorting.

    returns

    this SearchOptions for chaining.

  15. def sortByFields(fields: Seq[String]): SearchOptions

    Configures the list of fields (including special fields) which are used for sorting purposes.

    Configures the list of fields (including special fields) which are used for sorting purposes. If empty, the default sorting (descending by score) is used by the server.

    The list of sort fields can include actual fields (like "firstname" but then they must be stored in the index, configured in the server side mapping). Fields provided first are considered first and in a "tie" case the next sort field is considered. So sorting by "firstname" and then "lastname" will first sort ascending by the firstname and if the names are equal then sort ascending by lastname. Special fields like "_id" and "_score" can also be used. If prefixed with "-" the sort order is set to descending.

    If no sort is provided, it is equal to sort(Seq("-_score")), since the server will sort it by score in descending order.

    fields

    the fields that should take part in the sorting.

    returns

    this SearchOptions for chaining.

  16. def timeout(timeout: Duration): SearchOptions

    Sets a maximum timeout for processing.

    Sets a maximum timeout for processing.

    timeout

    the duration of the timeout.

    returns

    a copy of this with the change applied, for chaining.