PHP Class Spatie\SearchIndex\Query\Algolia\SearchQuery

Datei anzeigen Open project: spatie/searchindex Class Usage Examples

Protected Properties

Property Type Description
$aroundRadius integer
$dateRestrictions array
$facets array
$hitsPerPage integer
$lat integer
$lng integer
$numericFilters array
$page integer
$query
$useLocationAwareSearch boolean

Public Methods

Method 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 method

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

searchFor() public method

Set the query to search for.
public searchFor ( mixed $query ) : SearchQuery
$query mixed
return SearchQuery

setHitsPerPage() public method

public setHitsPerPage ( integer $hitsPerPage ) : SearchQuery
$hitsPerPage integer
return SearchQuery

setPage() public method

public setPage ( integer $page ) : SearchQuery
$page integer
return SearchQuery

toArray() public method

Get the query as an array.
public toArray ( ) : array
return array

withDateRestriction() public method

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

withFacet() public method

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

withNumericFilter() public method

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
return integer

$dateRestrictions protected_oe property

protected array $dateRestrictions
return array

$facets protected_oe property

protected array $facets
return array

$hitsPerPage protected_oe property

protected int $hitsPerPage
return integer

$lat protected_oe property

protected int $lat
return integer

$lng protected_oe property

protected int $lng
return integer

$numericFilters protected_oe property

protected array $numericFilters
return array

$page protected_oe property

protected int $page
return integer

$query protected_oe property

protected $query

$useLocationAwareSearch protected_oe property

protected bool $useLocationAwareSearch
return boolean