Constants

OPTION_SEARCH_TYPE

OPTION_SEARCH_TYPE

OPTION_ROUTING

OPTION_ROUTING

OPTION_PREFERENCE

OPTION_PREFERENCE

OPTION_VERSION

OPTION_VERSION

OPTION_TIMEOUT

OPTION_TIMEOUT

OPTION_FROM

OPTION_FROM

OPTION_SIZE

OPTION_SIZE

OPTION_SCROLL

OPTION_SCROLL

OPTION_SCROLL_ID

OPTION_SCROLL_ID

OPTION_QUERY_CACHE

OPTION_QUERY_CACHE

OPTION_TERMINATE_AFTER

OPTION_TERMINATE_AFTER

OPTION_SHARD_REQUEST_CACHE

OPTION_SHARD_REQUEST_CACHE

OPTION_SEARCH_TYPE_DFS_QUERY_THEN_FETCH

OPTION_SEARCH_TYPE_DFS_QUERY_THEN_FETCH

OPTION_SEARCH_TYPE_DFS_QUERY_AND_FETCH

OPTION_SEARCH_TYPE_DFS_QUERY_AND_FETCH

OPTION_SEARCH_TYPE_QUERY_THEN_FETCH

OPTION_SEARCH_TYPE_QUERY_THEN_FETCH

OPTION_SEARCH_TYPE_QUERY_AND_FETCH

OPTION_SEARCH_TYPE_QUERY_AND_FETCH

OPTION_SEARCH_TYPE_SUGGEST

OPTION_SEARCH_TYPE_SUGGEST

OPTION_SEARCH_IGNORE_UNAVAILABLE

OPTION_SEARCH_IGNORE_UNAVAILABLE

Properties

$_indices

$_indices : array

Array of indices.

Type

array

$_types

$_types : array

Array of types.

Type

array

$_options

$_options : array

Type

array

Methods

addIndex()

addIndex(\Elastica\Index|string  $index) : $this

Adds a index to the list.

Parameters

\Elastica\Index|string $index

Index object or string

Throws

\Elastica\Exception\InvalidException

Returns

$this

addIndices()

addIndices(array  $indices = array()) : $this

Add array of indices at once.

Parameters

array $indices

Returns

$this

addType()

addType(\Elastica\Type|string  $type) : $this

Adds a type to the current search.

Parameters

\Elastica\Type|string $type

Type name or object

Throws

\Elastica\Exception\InvalidException

Returns

$this

addTypes()

addTypes(array  $types = array()) : $this

Add array of types.

Parameters

array $types

Returns

$this

setOption()

setOption(string  $key, mixed  $value) : $this

Parameters

string $key
mixed $value

Returns

$this

setOptions()

setOptions(array  $options) : $this

Parameters

array $options

Returns

$this

clearOptions()

clearOptions() : $this

Returns

$this

addOption()

addOption(string  $key, mixed  $value) : $this

Parameters

string $key
mixed $value

Returns

$this

hasOption()

hasOption(string  $key) : boolean

Parameters

string $key

Returns

boolean

getOption()

getOption(string  $key) : mixed

Parameters

string $key

Throws

\Elastica\Exception\InvalidException

Returns

mixed

getOptions()

getOptions() : array

Returns

array

getClient()

getClient() : \Elastica\Client

Return client object.

Returns

\Elastica\Client

Client object

getIndices()

getIndices() : array

Return array of indices.

Returns

array —

List of index names

hasIndices()

hasIndices() : boolean

Returns

boolean

hasIndex()

hasIndex(\Elastica\Index|string  $index) : boolean

Parameters

\Elastica\Index|string $index

Returns

boolean

getTypes()

getTypes() : array

Return array of types.

Returns

array —

List of types

hasTypes()

hasTypes() : boolean

Returns

boolean

hasType()

hasType(\Elastica\Type|string  $type) : boolean

Parameters

\Elastica\Type|string $type

Returns

boolean

getPath()

getPath() : string

Combines indices and types to the search request path.

Returns

string —

Search path

search()

search(mixed  $query = '', integer|array  $options = null) : \Elastica\ResultSet

Search in the set indices, types.

Parameters

mixed $query
integer|array $options

OPTIONAL Limit or associative array of options (option=>value)

Throws

\Elastica\Exception\InvalidException

Returns

\Elastica\ResultSet

count()

count(mixed  $query = '',   $fullResult = false) : integer|\Elastica\ResultSet

Parameters

mixed $query
$fullResult

(default = false) By default only the total hit count is returned. If set to true, the full ResultSet including aggregations is returned

Returns

integer|\Elastica\ResultSet

setOptionsAndQuery()

setOptionsAndQuery(array|integer  $options = null, string|array|\Elastica\Query  $query = '') : $this

Parameters

array|integer $options
string|array|\Elastica\Query $query

Returns

$this

setSuggest()

setSuggest(\Elastica\Suggest  $suggest) : $this

Parameters

\Elastica\Suggest $suggest

Returns

$this

scroll()

scroll(string  $expiryTime = '1m') : \Elastica\Scroll

Returns the Scroll Iterator.

Parameters

string $expiryTime

Returns

\Elastica\Scroll

_validateOption()

_validateOption(string  $key) : boolean

Parameters

string $key

Throws

\Elastica\Exception\InvalidException

Returns

boolean