\ElasticaSearchableInterface

Elastica searchable interface.

Summary

Methods
Constants
search()
count()
createSearch()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

search()

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

Searches results for a query.

{ "from" : 0, "size" : 10, "sort" : { "postDate" : {"order" : "desc"}, "user" : { }, "_score" : { } }, "query" : { "term" : { "user" : "kimchy" } } }

Parameters

string|array|\Elastica\Query $query

Array with all query data inside or a Elastica\Query object

null $options
string $method

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

Returns

\Elastica\ResultSet

with all results inside

count()

count(string|array|\Elastica\Query  $query = '', string  $method = \Elastica\Request::POST) : integer

Counts results for a query.

If no query is set, matchall query is created

Parameters

string|array|\Elastica\Query $query

Array with all query data inside or a Elastica\Query object

string $method

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

Returns

integer —

number of documents matching the query

createSearch()

createSearch(\Elastica\Query|string  $query = '', array  $options = null) : \Elastica\Search

Parameters

\Elastica\Query|string $query
array $options

Returns

\Elastica\Search