include/SugarSearchEngine/Elastic/Elastica/Searchable.php
Elastica searchable interface
- Author
- Thibault Duplessis
- Category
- Xodoa
- Package
- Elastica
\Elastica_Searchable
Package: Elastica
Parameters
Returns
Parameters
Returns
Elastica searchable interface
- Children
- \Elastica_Type_Abstract
- \Elastica_Index
- \Elastica_Type
- Author
- Thibault Duplessis
- Category
- Xodoa
Methods
count(
string | array | \Elastica_Query $query
=
''
)
:
int
Counts results for a query
If no query is set, matchall query is created
Name | Type | Description |
---|---|---|
$query | string | array | \Elastica_Query | Array with all query data inside or a Elastica_Query object |
Type | Description |
---|---|
int | number of documents matching the query |
search(
string | array | \Elastica_Query $query
)
:
\Elastica_ResultSet
Searches results for a query
TODO: Improve sample code { "from" : 0, "size" : 10, "sort" : { "postDate" : {"reverse" : true}, "user" : { }, "_score" : { } }, "query" : { "term" : { "user" : "kimchy" } } }
Name | Type | Description |
---|---|---|
$query | string | array | \Elastica_Query | Array with all query data inside or a Elastica_Query object |
Type | Description |
---|---|
\Elastica_ResultSet | ResultSet with all results inside |