PHP Class Spatie\SearchIndex\Query\Algolia\SearchQuery

Afficher le fichier Open project: spatie/searchindex Class Usage Examples

Protected Properties

Свойство Type Description
$aroundRadius integer
$dateRestrictions array
$facets array
$hitsPerPage integer
$lat integer
$lng integer
$numericFilters array
$page integer
$query
$useLocationAwareSearch boolean

Méthodes publiques

Méthode Description
aroundLocation ( integer $lat, integer $lng, integer $aroundRadius = 30000 ) Create a location aware search.
searchFor ( mixed $query ) : SearchQuery Set the query to search for.
setHitsPerPage ( integer $hitsPerPage ) : SearchQuery
setPage ( integer $page ) : SearchQuery
toArray ( ) : array Get the query as an array.
withDateRestriction ( string $dateFieldName, string $operation, DateTime $date ) Set a date restriction.
withFacet ( string $name, string $value ) Set a facet.
withNumericFilter ( string $name, string | array $values, string $logicalOperator = 'and' ) Set a numeric filter.

Method Details

aroundLocation() public méthode

Create a location aware search.
public aroundLocation ( integer $lat, integer $lng, integer $aroundRadius = 30000 )
$lat integer
$lng integer
$aroundRadius integer

searchFor() public méthode

Set the query to search for.
public searchFor ( mixed $query ) : SearchQuery
$query mixed
Résultat SearchQuery

setHitsPerPage() public méthode

public setHitsPerPage ( integer $hitsPerPage ) : SearchQuery
$hitsPerPage integer
Résultat SearchQuery

setPage() public méthode

public setPage ( integer $page ) : SearchQuery
$page integer
Résultat SearchQuery

toArray() public méthode

Get the query as an array.
public toArray ( ) : array
Résultat array

withDateRestriction() public méthode

Set a date restriction.
public withDateRestriction ( string $dateFieldName, string $operation, DateTime $date )
$dateFieldName string
$operation string
$date DateTime

withFacet() public méthode

Set a facet.
public withFacet ( string $name, string $value )
$name string
$value string

withNumericFilter() public méthode

Set a numeric filter.
public withNumericFilter ( string $name, string | array $values, string $logicalOperator = 'and' )
$name string
$values string | array
$logicalOperator string

Property Details

$aroundRadius protected_oe property

protected int $aroundRadius
Résultat integer

$dateRestrictions protected_oe property

protected array $dateRestrictions
Résultat array

$facets protected_oe property

protected array $facets
Résultat array

$hitsPerPage protected_oe property

protected int $hitsPerPage
Résultat integer

$lat protected_oe property

protected int $lat
Résultat integer

$lng protected_oe property

protected int $lng
Résultat integer

$numericFilters protected_oe property

protected array $numericFilters
Résultat array

$page protected_oe property

protected int $page
Résultat integer

$query protected_oe property

protected $query

$useLocationAwareSearch protected_oe property

protected bool $useLocationAwareSearch
Résultat boolean