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_FILTER_PATH

OPTION_FILTER_PATH

OPTION_TYPED_KEYS

OPTION_TYPED_KEYS

OPTION_SEARCH_TYPE_DFS_QUERY_THEN_FETCH

OPTION_SEARCH_TYPE_DFS_QUERY_THEN_FETCH

OPTION_SEARCH_TYPE_QUERY_THEN_FETCH

OPTION_SEARCH_TYPE_QUERY_THEN_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

$_query

$_query : \Elastica\Query

Type

\Elastica\Query

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

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

getQuery()

getQuery() : \Elastica\Query

Returns

\Elastica\Query

getPath()

getPath() : string

Combines indices to the search request path.

Returns

string —

Search path

search()

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

Search in the set indices.

Parameters

mixed $query
integer|array $options

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

string $method

OPTIONAL Request method (use const's) (default = Request::POST)

Throws

\Elastica\Exception\InvalidException

Returns

\Elastica\ResultSet

count()

count(mixed  $query = '',   $fullResult = false, string  $method = \Elastica\Request::POST) : 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

string $method

OPTIONAL Request method (use const's) (default = Request::POST)

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