SearchQuery
in package
Table of Contents
Properties
- $attributesToCrop : array<int, non-empty-string>|null
- $attributesToHighlight : array<int, non-empty-string>|null
- $attributesToRetrieve : array<int, non-empty-string>|null
- $attributesToSearchOn : array<int, non-empty-string>|null
- $cropLength : positive-int|null
- $cropMarker : string|null
- $distinct : non-empty-string|null
- $facets : array<int, non-empty-string>|null
- $federationOptions : FederationOptions|null
- $filter : array<int, non-empty-string|array<int, non-empty-string>>|null
- $highlightPostTag : string|null
- $highlightPreTag : string|null
- $hitsPerPage : int|null
- $hybrid : HybridSearchOptions|null
- $indexUid : non-empty-string|null
- $limit : int|null
- $locales : array<int, non-empty-string>|null
- $matchingStrategy : "last"|"all"|"frequency"|null
- $offset : int|null
- $page : int|null
- $q : string|null
- $rankingScoreThreshold : float|null
- $showMatchesPosition : bool|null
- $showRankingScore : bool|null
- $showRankingScoreDetails : bool|null
- $sort : array<int, non-empty-string>|null
- $vector : array<int, float|array<int, float>>|null
Methods
- setAttributesToCrop() : $this
- setAttributesToHighlight() : $this
- setAttributesToRetrieve() : $this
- setAttributesToSearchOn() : $this
- setCropLength() : $this
- setCropMarker() : $this
- setDistinct() : $this
- setFacets() : $this
- setFederationOptions() : $this
- This option is only available while doing a federated search.
- setFilter() : $this
- setHighlightPostTag() : $this
- setHighlightPreTag() : $this
- setHitsPerPage() : $this
- setHybrid() : $this
- This is an EXPERIMENTAL feature, which may break without a major version.
- setIndexUid() : $this
- setLimit() : $this
- setLocales() : $this
- setMatchingStrategy() : $this
- setOffset() : $this
- setPage() : $this
- setQuery() : $this
- setRankingScoreThreshold() : $this
- setShowMatchesPosition() : $this
- setShowRankingScore() : $this
- setShowRankingScoreDetails() : $this
- This is an EXPERIMENTAL feature, which may break without a major version.
- setSort() : $this
- setVector() : $this
- This is an EXPERIMENTAL feature, which may break without a major version.
- toArray() : array<string|int, mixed>
Properties
$attributesToCrop
private
array<int, non-empty-string>|null
$attributesToCrop
= null
$attributesToHighlight
private
array<int, non-empty-string>|null
$attributesToHighlight
= null
$attributesToRetrieve
private
array<int, non-empty-string>|null
$attributesToRetrieve
= null
$attributesToSearchOn
private
array<int, non-empty-string>|null
$attributesToSearchOn
= null
$cropLength
private
positive-int|null
$cropLength
= null
$cropMarker
private
string|null
$cropMarker
= null
$distinct
private
non-empty-string|null
$distinct
= null
$facets
private
array<int, non-empty-string>|null
$facets
= null
$federationOptions
private
FederationOptions|null
$federationOptions
= null
$filter
private
array<int, non-empty-string|array<int, non-empty-string>>|null
$filter
= null
$highlightPostTag
private
string|null
$highlightPostTag
= null
$highlightPreTag
private
string|null
$highlightPreTag
= null
$hitsPerPage
private
int|null
$hitsPerPage
= null
non-negative-int|null
$hybrid
private
HybridSearchOptions|null
$hybrid
= null
$indexUid
private
non-empty-string|null
$indexUid
= null
$limit
private
int|null
$limit
= null
non-negative-int|null
$locales
private
array<int, non-empty-string>|null
$locales
= null
$matchingStrategy
private
"last"|"all"|"frequency"|null
$matchingStrategy
= null
$offset
private
int|null
$offset
= null
non-negative-int|null
$page
private
int|null
$page
= null
non-negative-int|null
$q
private
string|null
$q
= null
$rankingScoreThreshold
private
float|null
$rankingScoreThreshold
= null
$showMatchesPosition
private
bool|null
$showMatchesPosition
= null
$showRankingScore
private
bool|null
$showRankingScore
= null
$showRankingScoreDetails
private
bool|null
$showRankingScoreDetails
= null
$sort
private
array<int, non-empty-string>|null
$sort
= null
$vector
private
array<int, float|array<int, float>>|null
$vector
= null
Methods
setAttributesToCrop()
public
setAttributesToCrop(array<string|int, mixed> $attributesToCrop) : $this
Parameters
- $attributesToCrop : array<string|int, mixed>
Return values
$thissetAttributesToHighlight()
public
setAttributesToHighlight(array<int, non-empty-string> $attributesToHighlight) : $this
Parameters
- $attributesToHighlight : array<int, non-empty-string>
Return values
$thissetAttributesToRetrieve()
public
setAttributesToRetrieve(array<string|int, mixed> $attributesToRetrieve) : $this
Parameters
- $attributesToRetrieve : array<string|int, mixed>
Return values
$thissetAttributesToSearchOn()
public
setAttributesToSearchOn(array<int, non-empty-string> $attributesToSearchOn) : $this
Parameters
- $attributesToSearchOn : array<int, non-empty-string>
Return values
$thissetCropLength()
public
setCropLength(positive-int|null $cropLength) : $this
Parameters
- $cropLength : positive-int|null
Return values
$thissetCropMarker()
public
setCropMarker(string $cropMarker) : $this
Parameters
- $cropMarker : string
Return values
$thissetDistinct()
public
setDistinct(non-empty-string|null $distinct) : $this
Parameters
- $distinct : non-empty-string|null
Return values
$thissetFacets()
public
setFacets(array<int, non-empty-string> $facets) : $this
Parameters
- $facets : array<int, non-empty-string>
Return values
$thissetFederationOptions()
This option is only available while doing a federated search.
public
setFederationOptions(FederationOptions $federationOptions) : $this
If used in another context an error will be returned by Meilisearch.
Parameters
- $federationOptions : FederationOptions
Return values
$thissetFilter()
public
setFilter(array<int, non-empty-string|array<int, non-empty-string>> $filter) : $this
Parameters
- $filter : array<int, non-empty-string|array<int, non-empty-string>>
Return values
$thissetHighlightPostTag()
public
setHighlightPostTag(string $highlightPostTag) : $this
Parameters
- $highlightPostTag : string
Return values
$thissetHighlightPreTag()
public
setHighlightPreTag(string $highlightPreTag) : $this
Parameters
- $highlightPreTag : string
Return values
$thissetHitsPerPage()
public
setHitsPerPage(int|null $hitsPerPage) : $this
Parameters
- $hitsPerPage : int|null
Return values
$thissetHybrid()
This is an EXPERIMENTAL feature, which may break without a major version.
public
setHybrid(HybridSearchOptions $hybridOptions) : $this
Set hybrid search options (new HybridSearchOptions()) ->setSemanticRatio(0.8) ->setEmbedder('manual');
Parameters
- $hybridOptions : HybridSearchOptions
Return values
$thissetIndexUid()
public
setIndexUid(string $uid) : $this
Parameters
- $uid : string
Return values
$thissetLimit()
public
setLimit(int|null $limit) : $this
Parameters
- $limit : int|null
Return values
$thissetLocales()
public
setLocales(array<int, non-empty-string> $locales) : $this
Parameters
- $locales : array<int, non-empty-string>
Return values
$thissetMatchingStrategy()
public
setMatchingStrategy("last"|"all"|"frequency" $matchingStrategy) : $this
Parameters
- $matchingStrategy : "last"|"all"|"frequency"
Return values
$thissetOffset()
public
setOffset(int|null $offset) : $this
Parameters
- $offset : int|null
Return values
$thissetPage()
public
setPage(int|null $page) : $this
Parameters
- $page : int|null
Return values
$thissetQuery()
public
setQuery(string $q) : $this
Parameters
- $q : string
Return values
$thissetRankingScoreThreshold()
public
setRankingScoreThreshold(float|null $rankingScoreThreshold) : $this
Parameters
- $rankingScoreThreshold : float|null
Return values
$thissetShowMatchesPosition()
public
setShowMatchesPosition(bool|null $showMatchesPosition) : $this
Parameters
- $showMatchesPosition : bool|null
Return values
$thissetShowRankingScore()
public
setShowRankingScore(bool|null $showRankingScore) : $this
Parameters
- $showRankingScore : bool|null
Return values
$thissetShowRankingScoreDetails()
This is an EXPERIMENTAL feature, which may break without a major version.
public
setShowRankingScoreDetails(bool $showRankingScoreDetails) : $this
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
$thissetSort()
public
setSort(array<string|int, mixed> $sort) : $this
Parameters
- $sort : array<string|int, mixed>
Return values
$thissetVector()
This is an EXPERIMENTAL feature, which may break without a major version.
public
setVector(array<int, float|array<int, float>> $vector) : $this
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
$thistoArray()
public
toArray() : array<string|int, mixed>