include/SugarSearchEngine/Elastic/Elastica/Search.php
Elastica search object
- Author
- Nicolas Ruflin
- Category
- Xodoa
- Package
- Elastica
\Elastica_Search
Package: Elastica
Elastica search object
- Author
- Nicolas Ruflin
- Category
- Xodoa
Properties
Methods
__construct(
\Elastica_Client $client
)
:
void
Constructs search object
Parameters
Name | Type | Description |
---|---|---|
$client | \Elastica_Client | Client object |
addIndex(
\Elastica_Index | string $index
)
:
\Elastica_Search
Adds a index to the list
Parameters
Returns
Name | Type | Description |
---|---|---|
$index | \Elastica_Index | string | Index object or string |
Type | Description |
---|---|
\Elastica_Search | Current object |
addIndices(
array $indices
=
array()
)
:
\Elastica_Search
Add array of indices at once
Parameters
Returns
Name | Type | Description |
---|---|---|
$indices | array |
Type | Description |
---|---|
\Elastica_Search |
addType(
\Elastica_Type | string $type
)
:
\Elastica_Search
Adds a type to the current search
Parameters
Returns
Throws
Name | Type | Description |
---|---|---|
$type | \Elastica_Type | string | Type name or object |
Type | Description |
---|---|
\Elastica_Search | Search object |
Exception | Description |
---|---|
\Elastica_Exception_Invalid |
addTypes(
array $types
=
array()
)
:
\Elastica_Search
Add array of types
Parameters
Returns
Name | Type | Description |
---|---|---|
$types | array |
Type | Description |
---|---|
\Elastica_Search |
create(
\Elastica_Searchable $searchObject
)
:
void
static
Creates new search object
Parameters
Name | Type | Description |
---|---|---|
$searchObject | \Elastica_Searchable |
getPath(
)
:
string
Combines indices and types to the search request path
Returns
Type | Description |
---|---|
string | Search path |
search(
mixed $query, int $limit
=
0
)
:
\Elastica_ResultSet
Search in the set indices, types
Parameters
Returns
Name | Type | Description |
---|---|---|
$query | mixed | |
$limit | int | OPTIONAL |
Type | Description |
---|---|
\Elastica_ResultSet |