Meilisearch PHP | Documentation

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
$facets  : array<string|int, mixed>
$filter  : array<string|int, mixed>
$highlightPostTag  : string
$highlightPreTag  : string
$hitsPerPage  : int|null
$indexUid  : string
$limit  : int|null
$matchingStrategy  : string
$offset  : int|null
$page  : int|null
$q  : string
$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
setFacets()  : SearchQuery
setFilter()  : SearchQuery
setHighlightPostTag()  : SearchQuery
setHighlightPreTag()  : SearchQuery
setHitsPerPage()  : SearchQuery
setIndexUid()  : SearchQuery
setLimit()  : SearchQuery
setMatchingStrategy()  : SearchQuery
setOffset()  : SearchQuery
setPage()  : SearchQuery
setQuery()  : 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

$showMatchesPosition

private bool|null $showMatchesPosition

$showRankingScore

private bool|null $showRankingScore = null

$showRankingScoreDetails

private bool|null $showRankingScoreDetails = null

$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
SearchQuery

setAttributesToHighlight()

public setAttributesToHighlight(array<string|int, mixed> $attributesToHighlight) : SearchQuery
Parameters
$attributesToHighlight : array<string|int, mixed>
Return values
SearchQuery

setAttributesToRetrieve()

public setAttributesToRetrieve(array<string|int, mixed> $attributesToRetrieve) : SearchQuery
Parameters
$attributesToRetrieve : array<string|int, mixed>
Return values
SearchQuery

setAttributesToSearchOn()

public setAttributesToSearchOn(array<int, non-empty-string> $attributesToSearchOn) : SearchQuery
Parameters
$attributesToSearchOn : array<int, non-empty-string>
Return values
SearchQuery

setShowMatchesPosition()

public setShowMatchesPosition(bool|null $showMatchesPosition) : SearchQuery
Parameters
$showMatchesPosition : bool|null
Return values
SearchQuery

setShowRankingScoreDetails()

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
SearchQuery

setVector()

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
SearchQuery

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

On this page

Search results