Full Text Search
Note
Further updates to the search docs will come with future 4.0.x releases.
Enumerations
- enum couchbase.search.SearchScanConsistency(value)
SearchScanConsistency
This can be:
- NOT_BOUNDED
Which means we just return what is currently in the indexes.
Valid values are as follows:
- NOT_BOUNDED = <SearchScanConsistency.NOT_BOUNDED: 'not_bounded'>
- REQUEST_PLUS = <SearchScanConsistency.REQUEST_PLUS: 'request_plus'>
- AT_PLUS = <SearchScanConsistency.AT_PLUS: 'at_plus'>
Options
- class couchbase.options.SearchOptions(timeout=None, limit=None, skip=None, explain=None, fields=None, highlight_style=None, highlight_fields=None, scan_consistency=None, consistent_with=None, facets=None, raw=None, sort=None, disable_scoring=None, scope_name=None, collections=None, include_locations=None, client_context_id=None, serializer=None)
Available options to for a search (FTS) query.
Warning
Importing options from
couchbase.search
is deprecated. All options should be imported fromcouchbase.options
.- Parameters
timeout (timedelta, optional) – The timeout for this operation. Defaults to global search query operation timeout.
limit (int, optional) – Specifies the limit to the number of results that should be returned. Defaults to None.
skip (int, optional) – Specifies the number of results to skip from the index before returning results. Defaults to None.
explain (bool, optional) – Configures whether the result should contain the execution plan for the search query. Defaults to False.
fields (List[str], optional) – Specifies the list of fields which should be searched. Defaults to None.
highlight_style (
HighlightStyle
, optional) – Specifies the mode used for highlighting. Defaults to None.highlight_fields (List[str], optional) – Specifies the list of fields that should be highlighted. Defaults to None.
scan_consistency (
SearchScanConsistency
, optional) – Specifies the consistency requirements when executing the search query.facets (Dict[str,
Facet
], optional) – Specifies any facets that should be included in the search query. Defaults to None.client_context_id (str, optional) – The returned client context id for this query. Defaults to None.
disable_scoring (bool, optional) – Specifies that scoring should be disabled. This improves performance but makes it impossible to sort based on how well a particular result scored. Defaults to False.
include_locations (bool optional) – If set to True, will include the locations in the search result. Defaults to False.
sort (Union[List[str],List[
Sort
]], optional) – Specifies a list of fields or searchSort
’s to use when sorting the result sets. Defaults to None.scope_name (string, optional) – Specifies the scope which should be searched as part of the search query. Defaults to None.
collections (List[str], optional) – Specifies the collections which should be searched as part of the search query. Defaults to None.
consistent_with (
MutationState
, optional) – Specifies aMutationState
which the search query should be consistent with. Defaults to None.serializer (
Serializer
, optional) – Specifies an explicit serializer to use for this specific search query. Defaults toDefaultJsonSerializer
.raw (Dict[str, Any], optional) – Specifies any additional parameters which should be passed to the search query engine when executing the search query. Defaults to None.
Results
SearchMetaData
- class couchbase.search.SearchMetaData(raw)
Represents the meta-data returned along with a search query result.
SearchMetrics
- class couchbase.search.SearchMetrics(raw)
SearchResult
- class couchbase.result.SearchResult
- rows()
The rows which have been returned by the search query.
Note
If using the acouchbase API be sure to use
async for
when looping over rows.- Returns
Either an iterable or async iterable.
- Return type
Iterable
- metadata()
The meta-data which has been returned by the search query.
- Returns
An instance of
SearchMetaData
.- Return type