SearchQuery
in package
Table of Contents
Properties
- $attributesToCrop : array<string|int, mixed>
- $attributesToHighlight : array<string|int, mixed>
- $attributesToRetrieve : array<string|int, mixed>
- $attributesToSearchOn : array<string|int, mixed>|null
- $cropLength : int|null
- $cropMarker : string
- $distinct : string|null
- $facets : array<string|int, mixed>
- $federationOptions : FederationOptions|null
- $filter : array<string|int, mixed>
- $highlightPostTag : string
- $highlightPreTag : string
- $hitsPerPage : int|null
- $hybrid : HybridSearchOptions|null
- $indexUid : string
- $limit : int|null
- $locales : array<string|int, mixed>
- $matchingStrategy : string
- $offset : int|null
- $page : int|null
- $q : string
- $rankingScoreThreshold : float|null
- $showMatchesPosition : bool|null
- $showRankingScore : bool|null
- $showRankingScoreDetails : bool|null
- $sort : array<string|int, mixed>
- $vector : array<string|int, mixed>|null
Methods
- setAttributesToCrop() : SearchQuery
- setAttributesToHighlight() : SearchQuery
- setAttributesToRetrieve() : SearchQuery
- setAttributesToSearchOn() : SearchQuery
- setCropLength() : SearchQuery
- setCropMarker() : SearchQuery
- setDistinct() : SearchQuery
- setFacets() : SearchQuery
- setFederationOptions() : SearchQuery
- This option is only available while doing a federated search.
- setFilter() : SearchQuery
- setHighlightPostTag() : SearchQuery
- setHighlightPreTag() : SearchQuery
- setHitsPerPage() : SearchQuery
- setHybrid() : SearchQuery
- This is an EXPERIMENTAL feature, which may break without a major version.
- setIndexUid() : SearchQuery
- setLimit() : SearchQuery
- setLocales() : SearchQuery
- setMatchingStrategy() : SearchQuery
- setOffset() : SearchQuery
- setPage() : SearchQuery
- setQuery() : SearchQuery
- setRankingScoreThreshold() : SearchQuery
- setShowMatchesPosition() : SearchQuery
- setShowRankingScore() : SearchQuery
- setShowRankingScoreDetails() : SearchQuery
- This is an EXPERIMENTAL feature, which may break without a major version.
- setSort() : SearchQuery
- setVector() : SearchQuery
- This is an EXPERIMENTAL feature, which may break without a major version.
- toArray() : array<string|int, mixed>
Properties
$attributesToCrop
private
array<string|int, mixed>
$attributesToCrop
$attributesToHighlight
private
array<string|int, mixed>
$attributesToHighlight
$attributesToRetrieve
private
array<string|int, mixed>
$attributesToRetrieve
$attributesToSearchOn
private
array<string|int, mixed>|null
$attributesToSearchOn
= null
$cropLength
private
int|null
$cropLength
$cropMarker
private
string
$cropMarker
$distinct
private
string|null
$distinct
= null
$facets
private
array<string|int, mixed>
$facets
$federationOptions
private
FederationOptions|null
$federationOptions
= null
$filter
private
array<string|int, mixed>
$filter
$highlightPostTag
private
string
$highlightPostTag
$highlightPreTag
private
string
$highlightPreTag
$hitsPerPage
private
int|null
$hitsPerPage
$hybrid
private
HybridSearchOptions|null
$hybrid
= null
$indexUid
private
string
$indexUid
$limit
private
int|null
$limit
$locales
private
array<string|int, mixed>
$locales
$matchingStrategy
private
string
$matchingStrategy
$offset
private
int|null
$offset
$page
private
int|null
$page
$q
private
string
$q
$rankingScoreThreshold
private
float|null
$rankingScoreThreshold
= null
$showMatchesPosition
private
bool|null
$showMatchesPosition
$showRankingScore
private
bool|null
$showRankingScore
= null
$showRankingScoreDetails
private
bool|null
$showRankingScoreDetails
= null
$sort
private
array<string|int, mixed>
$sort
$vector
private
array<string|int, mixed>|null
$vector
Methods
setAttributesToCrop()
public
setAttributesToCrop(array<string|int, mixed> $attributesToCrop) : SearchQuery
Parameters
- $attributesToCrop : array<string|int, mixed>
Return values
SearchQuerysetAttributesToHighlight()
public
setAttributesToHighlight(array<string|int, mixed> $attributesToHighlight) : SearchQuery
Parameters
- $attributesToHighlight : array<string|int, mixed>
Return values
SearchQuerysetAttributesToRetrieve()
public
setAttributesToRetrieve(array<string|int, mixed> $attributesToRetrieve) : SearchQuery
Parameters
- $attributesToRetrieve : array<string|int, mixed>
Return values
SearchQuerysetAttributesToSearchOn()
public
setAttributesToSearchOn(array<int, non-empty-string> $attributesToSearchOn) : SearchQuery
Parameters
- $attributesToSearchOn : array<int, non-empty-string>
Return values
SearchQuerysetCropLength()
public
setCropLength(int|null $cropLength) : SearchQuery
Parameters
- $cropLength : int|null
Return values
SearchQuerysetCropMarker()
public
setCropMarker(string $cropMarker) : SearchQuery
Parameters
- $cropMarker : string
Return values
SearchQuerysetDistinct()
public
setDistinct(non-empty-string|null $distinct) : SearchQuery
Parameters
- $distinct : non-empty-string|null
Return values
SearchQuerysetFacets()
public
setFacets(array<string|int, mixed> $facets) : SearchQuery
Parameters
- $facets : array<string|int, mixed>
Return values
SearchQuerysetFederationOptions()
This option is only available while doing a federated search.
public
setFederationOptions(FederationOptions $federationOptions) : SearchQuery
If used in another context an error will be returned by Meilisearch.
Parameters
- $federationOptions : FederationOptions
Return values
SearchQuerysetFilter()
public
setFilter(array<string|int, mixed> $filter) : SearchQuery
Parameters
- $filter : array<string|int, mixed>
Return values
SearchQuerysetHighlightPostTag()
public
setHighlightPostTag(string $highlightPostTag) : SearchQuery
Parameters
- $highlightPostTag : string
Return values
SearchQuerysetHighlightPreTag()
public
setHighlightPreTag(string $highlightPreTag) : SearchQuery
Parameters
- $highlightPreTag : string
Return values
SearchQuerysetHitsPerPage()
public
setHitsPerPage(int|null $hitsPerPage) : SearchQuery
Parameters
- $hitsPerPage : int|null
Return values
SearchQuerysetHybrid()
This is an EXPERIMENTAL feature, which may break without a major version.
public
setHybrid(HybridSearchOptions $hybridOptions) : SearchQuery
Set hybrid search options (new HybridSearchOptions()) ->setSemanticRatio(0.8) ->setEmbedder('manual');
Parameters
- $hybridOptions : HybridSearchOptions
Return values
SearchQuerysetIndexUid()
public
setIndexUid(string $uid) : SearchQuery
Parameters
- $uid : string
Return values
SearchQuerysetLimit()
public
setLimit(int|null $limit) : SearchQuery
Parameters
- $limit : int|null
Return values
SearchQuerysetLocales()
public
setLocales(array<int, non-empty-string> $locales) : SearchQuery
Parameters
- $locales : array<int, non-empty-string>
Return values
SearchQuerysetMatchingStrategy()
public
setMatchingStrategy(string $matchingStrategy) : SearchQuery
Parameters
- $matchingStrategy : string
Return values
SearchQuerysetOffset()
public
setOffset(int|null $offset) : SearchQuery
Parameters
- $offset : int|null
Return values
SearchQuerysetPage()
public
setPage(int|null $page) : SearchQuery
Parameters
- $page : int|null
Return values
SearchQuerysetQuery()
public
setQuery(string $q) : SearchQuery
Parameters
- $q : string
Return values
SearchQuerysetRankingScoreThreshold()
public
setRankingScoreThreshold(float|null $rankingScoreThreshold) : SearchQuery
Parameters
- $rankingScoreThreshold : float|null
Return values
SearchQuerysetShowMatchesPosition()
public
setShowMatchesPosition(bool|null $showMatchesPosition) : SearchQuery
Parameters
- $showMatchesPosition : bool|null
Return values
SearchQuerysetShowRankingScore()
public
setShowRankingScore(bool|null $showRankingScore) : SearchQuery
Parameters
- $showRankingScore : bool|null
Return values
SearchQuerysetShowRankingScoreDetails()
This is an EXPERIMENTAL feature, which may break without a major version.
public
setShowRankingScoreDetails(bool $showRankingScoreDetails) : SearchQuery
It's available after Meilisearch v1.3. To enable it properly and use ranking scoring details its required to opt-in through the /experimental-features route.
More info: https://www.meilisearch.com/docs/reference/api/experimental-features
Parameters
- $showRankingScoreDetails : bool
-
whether the feature is enabled or not
Return values
SearchQuerysetSort()
public
setSort(array<string|int, mixed> $sort) : SearchQuery
Parameters
- $sort : array<string|int, mixed>
Return values
SearchQuerysetVector()
This is an EXPERIMENTAL feature, which may break without a major version.
public
setVector(array<int, float|array<int, float>> $vector) : SearchQuery
It's available from Meilisearch v1.3. To enable it properly and use vector store capabilities it's required to activate it through the /experimental-features route.
More info: https://www.meilisearch.com/docs/reference/api/experimental-features
Parameters
- $vector : array<int, float|array<int, float>>
-
a multi-level array floats
Return values
SearchQuerytoArray()
public
toArray() : array<string|int, mixed>