\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) : \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

Returns

\Elastica\ResultSet

with all results inside

count()

count(string|array|\Elastica\Query  $query = '') : 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

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