PHP Class ElasticSearcher\Abstracts\AbstractQuery

Inheritance: use trait ElasticSearcher\Traits\BodyTrait
Afficher le fichier Open project: madewithlove/elasticsearcher Class Usage Examples

Protected Properties

Свойство Type Description
$data array Data that can be used when building a query.
$fragmentParser ElasticSearcher\Parsers\FragmentParser
$indices array Indices on which the query should be executed.
$queryStringParams array Parameters to be added to the search URL.
$resultParser ElasticSearcher\Abstracts\AbstractResultParser
$searcher ElasticSearcher\ElasticSearcher
$types array Types on which the query should be executed.

Méthodes publiques

Méthode Description
__construct ( ElasticSearcher $searcher )
addData ( array $data ) Add data that can be accessed during query building.
getData ( $key = null ) : mixed
getIndices ( ) : array Indices we are searching in.
getRawQuery ( ) : array Get the query after being build.
getResultParser ( ) : mixed
getTypes ( ) : array Types we are searching in.
parseResultsWith ( ElasticSearcher\Abstracts\AbstractResultParser $resultParser )
run ( ) : ElasticSearcher\Abstracts\AbstractResultParser Build and execute the query.
searchIn ( string | array $index, null | string | array $type = null ) Define on which indices and types the query should be run.

Méthodes protégées

Méthode Description
buildQuery ( ) : array Build the query by adding all chunks together.
getQueryStringParam ( string $name ) : mixed
getSearchType ( ) : string
removeQueryStringParam ( string $name )
searchInIndices ( array $indices )
searchInTypes ( array $types )
setQueryStringParam ( string $name, mixed $value )
setSearchType ( string $type )
setup ( ) Prepare the query. Add filters, sorting, .

Method Details

__construct() public méthode

public __construct ( ElasticSearcher $searcher )
$searcher ElasticSearcher\ElasticSearcher

addData() public méthode

Add data that can be accessed during query building.
public addData ( array $data )
$data array

buildQuery() protected méthode

Build the query by adding all chunks together.
protected buildQuery ( ) : array
Résultat array

getData() public méthode

public getData ( $key = null ) : mixed
Résultat mixed

getIndices() public méthode

Indices we are searching in.
public getIndices ( ) : array
Résultat array

getQueryStringParam() protected méthode

protected getQueryStringParam ( string $name ) : mixed
$name string
Résultat mixed

getRawQuery() public méthode

This is what will be sent to the elasticsearch SDK.
public getRawQuery ( ) : array
Résultat array

getResultParser() public méthode

public getResultParser ( ) : mixed
Résultat mixed

getSearchType() protected méthode

protected getSearchType ( ) : string
Résultat string

getTypes() public méthode

Types we are searching in.
public getTypes ( ) : array
Résultat array

parseResultsWith() public méthode

public parseResultsWith ( ElasticSearcher\Abstracts\AbstractResultParser $resultParser )
$resultParser ElasticSearcher\Abstracts\AbstractResultParser

removeQueryStringParam() protected méthode

protected removeQueryStringParam ( string $name )
$name string

run() public méthode

Build and execute the query.
public run ( ) : ElasticSearcher\Abstracts\AbstractResultParser
Résultat ElasticSearcher\Abstracts\AbstractResultParser

searchIn() public méthode

Define on which indices and types the query should be run.
public searchIn ( string | array $index, null | string | array $type = null )
$index string | array
$type null | string | array

searchInIndices() protected méthode

protected searchInIndices ( array $indices )
$indices array

searchInTypes() protected méthode

protected searchInTypes ( array $types )
$types array

setQueryStringParam() protected méthode

protected setQueryStringParam ( string $name, mixed $value )
$name string
$value mixed

setSearchType() protected méthode

See also: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-type.html
protected setSearchType ( string $type )
$type string

setup() abstract protected méthode

...
abstract protected setup ( )

Property Details

$data protected_oe property

Data that can be used when building a query.
protected array $data
Résultat array

$fragmentParser protected_oe property

protected FragmentParser,ElasticSearcher\Parsers $fragmentParser
Résultat ElasticSearcher\Parsers\FragmentParser

$indices protected_oe property

Indices on which the query should be executed.
protected array $indices
Résultat array

$queryStringParams protected_oe property

Parameters to be added to the search URL.
protected array $queryStringParams
Résultat array

$resultParser protected_oe property

protected AbstractResultParser,ElasticSearcher\Abstracts $resultParser
Résultat ElasticSearcher\Abstracts\AbstractResultParser

$searcher protected_oe property

protected ElasticSearcher,ElasticSearcher $searcher
Résultat ElasticSearcher\ElasticSearcher

$types protected_oe property

Types on which the query should be executed.
protected array $types
Résultat array