cbelasticsearch.iNativeClient
Elasticsearch Native Client Interface
Method Summary | |
---|---|
boolean
|
applyIndex(IndexBuilder indexBuilder)
Applies an index item ( create/update ). |
struct
|
applyMapping(string indexName, string mappingName, struct mappingConfig)
Applies a single mapping to an index. |
struct
|
applyMappings(string indexName, struct mappings)
Applies multiple mappings to an index. |
void
|
close()
Closes any connections to the pool and destroys the client singleton. |
boolean
|
delete(any document, [boolean throwOnError])
Deletes a single document. |
any
|
deleteAll(array documents, [boolean throwOnError])
Deletes documents from an array of documents or IDs. |
boolean
|
deleteByQuery(SearchBuilder searchBuilder)
Deletes items in the index by query. |
struct
|
deleteIndex(string indexName)
Deletes an index. |
boolean
|
deleteMapping(string indexName, string mapping, [boolean throwOnError])
Deletes a mapping. |
SearchResult
|
executeSearch(SearchBuilder searchBuilder)
Execute a client search request. |
any
|
get(any id, [string index], [string type])
Retrieves a document by ID. |
array
|
getMultiple(array keys, [string index], [string type])
Gets multiple items when provided an array of keys. |
boolean
|
indexExists(string indexName)
Verifies whether an index exists. |
boolean
|
indexMappingExists(string indexName, string mapping)
Verifies whether an index mapping exists. |
Document
|
save(Document document)
|
array
|
saveAll(array documents)
Persists multiple items to the index. |
boolean
|
updateByQuery(SearchBuilder searchBuilder, struct script)
Updates items in the index by query. |
Method Detail |
---|
Applies an index item ( create/update )
indexBuilder
- IndexBuilder An instance of the IndexBuilder objectApplies a single mapping to an index
indexName
- string the name of the indexmappingName
- string the name of the mappingmappingConfig
- struct the mapping configuration structApplies multiple mappings to an index
indexName
- string The name of the indexmappings
- struct a struct containing the mapping configurationCloses any connections to the pool and destroys the client singleton
Deletes a single document
document
- Document the Document object for the document to be deletedthrowOnError
- boolean whether to throw an error if the document cannot be deleted ( default: false )Deletes documents from an array of documents or IDs
documents
- array Either an array of Document objectsthrowOnError
- boolean whether to throw an error if the document cannot be deleted ( default: false )Deletes items in the index by query
searchBuilder
- SearchBuilder The search builder object to use for the queryDeletes an index
indexName
- string the name of the index to be deletedDeletes a mapping
indexName
- string the name of the index which contains the mappingmapping
- string the mapping ( e.g. type ) to deletethrowOnError
- boolean Whether to throw an error if the mapping could not be deleted ( default=false )Execute a client search request
searchBuilder
- SearchBuilder An instance of the SearchBuilder objectRetrieves a document by ID
id
- any The document keyindex
- string The name of the indextype
- type The name of the typeGets multiple items when provided an array of keys
keys
- array An array of keys to retrieveindex
- string The name of the indextype
- type The name of the typeVerifies whether an index exists
indexName
- string the name of the indexVerifies whether an index mapping exists
indexName
- string the name of the indexmapping
- string the name of the mappingdocument
- Document@cbElasticSearch An instance of the elasticsearch Document objectPersists multiple items to the index
documents
- array An array of elasticsearch Document objects to persistUpdates items in the index by query
searchBuilder
- SearchBuilder The search builder object to use for the queryscript
- struct script to process on the query