Property | Type | Description | |
---|---|---|---|
$_client | Client object. | ||
$_name | Index name. |
Method | Description | |
---|---|---|
__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 |
return |
public clearCache ( ) : |
||
return | 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) |
return | Server response |
public delete ( ) : |
||
return | Response object |
public deleteDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
return |
public flush ( $options = [] ) : |
||
return | Response object |
public forcemerge ( array $args = [] ) : array | ||
$args | array | OPTIONAL Additional arguments |
return | array | Server response |
public getAliases ( ) : array | ||
return | array | Aliases |
public getClient ( ) : |
||
return | Index client object |
public getMapping ( ) : array | ||
return | array |
public getSettings ( ) : |
||
return | Settings object |
public getStats ( ) : |
||
return |
public refresh ( ) : |
||
return | Response object |
public removeAlias ( string $name ) : |
||
$name | string | Alias name |
return | 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 |
return | 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) |
return | with all results inside |
public setSettings ( array $data ) : |
||
$data | array | Data array |
return | Response object |
public updateDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
return |