MAX_DOCS_PER_REQUEST
MAX_DOCS_PER_REQUEST
Abstract helper class to implement search indices based on models.
This abstract model should help creating search index and a subtype with some easy config entries that are overloaded.
The following variables have to be set:
The following variables can be set for additional configuration
$_client : \Elastica\Client
Client.
$_index : \Elastica\Index
Index.
$_type : \Elastica\Type
Type.
__construct(\Elastica\Client $client = null)
Creates index object with client connection.
Reads index and type name from protected vars _indexName and _typeName. Has to be set in child class
\Elastica\Client | $client | OPTIONAL Client object |
createSearch(string|\Elastica\Query $query = '', array|integer $options = null) : \Elastica\Search
string|\Elastica\Query | $query | |
array|integer | $options |
search(string|array|\Elastica\Query $query = '', null $options = null) : \Elastica\ResultSet
Search on the type.
TODO: Improve sample code { "from" : 0, "size" : 10, "sort" : { "postDate" : {"reverse" : true}, "user" : { }, "_score" : { } }, "query" : { "term" : { "user" : "kimchy" } } }
string|array|\Elastica\Query | $query | Array with all query data inside or a Elastica\Query object |
null | $options |
with all results inside
count(string|array|\Elastica\Query $query = '') : integer
Count docs in the type based on query.
If no query is set, matchall query is created
string|array|\Elastica\Query | $query | Array with all query data inside or a Elastica\Query object |
number of documents matching the query
getIndex() : \Elastica\Index
Returns the search index.
Index object
getType() : \Elastica\Type
Returns type object.
Type object