HIGHLIGHT_HTML
HIGHLIGHT_HTML
Represents full text search query
boolean() : \Couchbase\BooleanSearchQuery
Prepare boolean search query
dateRange() : \Couchbase\DateRangeSearchQuery
Prepare date range search query
numericRange() : \Couchbase\NumericRangeSearchQuery
Prepare numeric range search query
termRange() : \Couchbase\TermRangeSearchQuery
Prepare term range search query
booleanField(boolean $value) : \Couchbase\BooleanFieldSearchQuery
Prepare boolean field search query
boolean | $value |
conjuncts(\Couchbase\SearchQueryPart $queries) : \Couchbase\ConjunctionSearchQuery
Prepare compound conjunction search query
\Couchbase\SearchQueryPart | $queries | list of inner query parts |
disjuncts(\Couchbase\SearchQueryPart $queries) : \Couchbase\DisjunctionSearchQuery
Prepare compound disjunction search query
\Couchbase\SearchQueryPart | $queries | list of inner query parts |
docId(string $documentIds) : \Couchbase\DocIdSearchQuery
Prepare document ID search query
string | $documentIds |
match(string $match) : \Couchbase\MatchSearchQuery
Prepare match search query
string | $match |
matchAll() : \Couchbase\MatchAllSearchQuery
Prepare match all search query
matchNone() : \Couchbase\MatchNoneSearchQuery
Prepare match non search query
matchPhrase(string $terms) : \Couchbase\MatchPhraseSearchQuery
Prepare phrase search query
string | $terms |
prefix(string $prefix) : \Couchbase\PrefixSearchQuery
Prepare prefix search query
string | $prefix |
queryString(string $queryString) : \Couchbase\QueryStringSearchQuery
Prepare query string search query
string | $queryString |
regexp(string $regexp) : \Couchbase\RegexpSearchQuery
Prepare regexp search query
string | $regexp |
term(string $term) : \Couchbase\TermSearchQuery
Prepare term search query
string | $term |
wildcard(string $wildcard) : \Couchbase\WildcardSearchQuery
Prepare wildcard search query
string | $wildcard |
geoDistance(float $longitude, float $latitude, string $distance) : \Couchbase\GeoDistanceSearchQuery
Prepare geo distance search query
float | $longitude | |
float | $latitude | |
string | $distance | e.g. "10mi" |
geoBoundingBox(float $topLeftLongitude, float $topLeftLatitude, float $bottomRightLongitude, float $bottomRightLatitude) : \Couchbase\GeoBoundingBoxSearchQuery
Prepare geo bounding box search query
float | $topLeftLongitude | |
float | $topLeftLatitude | |
float | $bottomRightLongitude | |
float | $bottomRightLatitude |
termFacet(string $field, integer $limit) : \Couchbase\TermSearchFacet
Prepare term search facet
string | $field | |
integer | $limit |
dateRangeFacet(string $field, integer $limit) : \Couchbase\DateRangeSearchFacet
Prepare date range search facet
string | $field | |
integer | $limit |
numericRangeFacet(string $field, integer $limit) : \Couchbase\NumericRangeSearchFacet
Prepare numeric range search facet
string | $field | |
integer | $limit |
__construct(string $indexName, \Couchbase\SearchQueryPart $queryPart)
Prepare an FTS SearchQuery on an index.
Top level query parameters can be set after that by using the fluent API.
string | $indexName | the FTS index to search in |
\Couchbase\SearchQueryPart | $queryPart | the body of the FTS query (e.g. a match phrase query) |
limit(integer $limit) : \Couchbase\SearchQuery
Add a limit to the query on the number of hits it can return
integer | $limit | the maximum number of hits to return |
skip(integer $skip) : \Couchbase\SearchQuery
Set the number of hits to skip (eg. for pagination).
integer | $skip | the number of results to skip |
explain(boolean $explain) : \Couchbase\SearchQuery
Activates the explanation of each result hit in the response
boolean | $explain |
serverSideTimeout(integer $serverSideTimeout) : \Couchbase\SearchQuery
Sets the server side timeout in milliseconds
integer | $serverSideTimeout | the server side timeout to apply |
consistentWith(\Couchbase\MutationState $state) : \Couchbase\SearchQuery
Sets the consistency to consider for this FTS query to AT_PLUS and uses the MutationState to parameterize the consistency.
This replaces any consistency tuning previously set.
\Couchbase\MutationState | $state | the mutation state information to work with |
fields(string $fields) : \Couchbase\SearchQuery
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 fields in each hit. Note that to be highlighted, the fields must be stored in the FTS index.
string | $fields |
highlight(string $style, string $fields) : \Couchbase\SearchQuery
Configures the highlighting of matches in the response
string | $style | highlight style to apply. Use constants HIGHLIGHT_HTML, HIGHLIGHT_ANSI, HIGHLIGHT_SIMPLE. |
string | $fields | the optional fields on which to highlight. If none, all fields where there is a match are highlighted. |
sort( $sort) : \Couchbase\SearchQuery
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("-_score"), since the server will sort it by score in descending order.
$sort |
addFacet(string $name, \Couchbase\SearchFacet $facet) : \Couchbase\SearchQuery
Adds one SearchFacet to the query
This is an additive operation (the given facets are added to any facet previously requested), but if an existing facet has the same name it will be replaced.
Note that to be faceted, a field's value must be stored in the FTS index.
string | $name | |
\Couchbase\SearchFacet | $facet |