Свойство | Тип | Описание | |
---|---|---|---|
$_client | Client object. | ||
$_name | Index name. |
Метод | Описание | |
---|---|---|
__construct ( |
Creates a new index object. | |
addAlias ( string $name, boolean $replace = false ) : |
Adds an alias to the current index. | |
addDocuments ( array $docs ) : |
Uses _bulk to send documents to the server. | |
analyze ( string $text, array $args = [] ) : array | Analyzes a string. | |
clearCache ( ) : |
Clears the cache of an index. | |
close ( ) : |
Closes the index. | |
count ( string | array | |
Counts results of query. | |
create ( array $args = [], boolean | array $options = null ) : |
Creates a new index with the given arguments. | |
createSearch ( string | array | |
||
delete ( ) : |
Deletes the index. | |
deleteByQuery ( |
Deletes entries in the db based on a query. | |
deleteDocuments ( array $docs ) : |
Uses _bulk to delete documents from the server. | |
exists ( ) : boolean | Checks if the given index is already created. | |
flush ( $options = [] ) : |
Flushes the index to storage. | |
forcemerge ( array $args = [] ) : array | Force merges index. | |
getAliases ( ) : array | Returns all index aliases. | |
getClient ( ) : |
Returns index client. | |
getMapping ( ) : array | Gets all the type mappings for an index. | |
getName ( ) : string | Returns the index name. | |
getSettings ( ) : |
Returns the index settings object. | |
getStats ( ) : |
Return Index Stats. | |
getType ( string $type ) : |
Returns a type object for the current index with the given name. | |
hasAlias ( string $name ) : boolean | Checks if the index has the given alias. | |
open ( ) : |
Opens an index. | |
optimize ( array $args = [] ) : array | Optimizes search index. | |
refresh ( ) : |
Refreshes the index. | |
removeAlias ( string $name ) : |
Removes an alias pointing to the current index. | |
request ( string $path, string $method, array | string $data = [], array $query = [] ) : |
Makes calls to the elasticsearch server based on this index. | |
search ( string | array | |
Searches in this index. | |
setSettings ( array $data ) : |
Can be used to change settings during runtime. One example is to use it for bulk updating. | |
updateDocuments ( array $docs ) : |
Uses _bulk to send documents to the server. |
public __construct ( |
||
$client | Client object | |
$name | string | Index name |
public addDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
Результат |
public clearCache ( ) : |
||
Результат | Response object |
public close ( ) : |
||
Результат | Response object |
public create ( array $args = [], boolean | array $options = null ) : |
||
$args | array | OPTIONAL Arguments to use |
$options | boolean | array | OPTIONAL bool=> Deletes index first if already exists (default = false). array => Associative array of options (option=>value) |
Результат | Server response |
public delete ( ) : |
||
Результат | Response object |
public deleteDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
Результат |
public flush ( $options = [] ) : |
||
Результат | Response object |
public forcemerge ( array $args = [] ) : array | ||
$args | array | OPTIONAL Additional arguments |
Результат | array | Server response |
public getAliases ( ) : array | ||
Результат | array | Aliases |
public getClient ( ) : |
||
Результат | Index client object |
public getMapping ( ) : array | ||
Результат | array |
public getSettings ( ) : |
||
Результат | Settings object |
public getStats ( ) : |
||
Результат |
public open ( ) : |
||
Результат | Response object |
public refresh ( ) : |
||
Результат | Response object |
public removeAlias ( string $name ) : |
||
$name | string | Alias name |
Результат | Response |
public request ( string $path, string $method, array | string $data = [], array $query = [] ) : |
||
$path | string | Path to call |
$method | string | Rest method to use (GET, POST, DELETE, PUT) |
$data | array | string | OPTIONAL Arguments as array or encoded string |
$query | array | OPTIONAL Query params |
Результат | Response object |
public search ( string | array | |
||
$query | string | array | |
Array with all query data inside or a Elastica\Query object |
$options | integer | array | OPTIONAL Limit or associative array of options (option=>value) |
Результат | with all results inside |
public setSettings ( array $data ) : |
||
$data | array | Data array |
Результат | Response object |
public updateDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
Результат |