lucee.Componentcbelasticsearch.Client
Elasticsearch Client
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
nativeClient
Properties created on init().
|
true
|
false
|
|
any
|
wirebox
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
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 mappings to an index. |
any
|
close()
Pool close method. |
boolean
|
delete(any document, [boolean throwOnError='true'])
Deletes a single document. |
any
|
deleteAll(array documents, [boolean throwOnError='false'])
Deletes documents from an array of documents or IDs. |
boolean
|
deleteByQuery(SearchBuilder searchBuilder)
Delete documents from a query. |
struct
|
deleteIndex(string indexName)
Deletes an index. |
boolean
|
deleteMapping(string indexName, string mapping, [boolean throwOnError='false'])
Deletes a mapping. |
boolean
|
deleteType(string indexName, string type)
Deletes an index type. |
SearchResult
|
executeSearch(SearchBuilder searchBuilder)
Execute a client search request. |
any
|
get(any id, [string index], [string type])
Retrieves a document by ID. |
any
|
getConfig()
Provider for Config object. |
array
|
getMultiple(array keys, [string index], [string type])
Gets multiple items when provided an array of keys. |
string
|
getNativeClient()
|
any
|
getSearchBuilder()
Provider for search builder. |
string
|
getWirebox()
|
boolean
|
indexExists(string indexName)
Verifies whether an index exists. |
boolean
|
indexMappingExists(string indexName, string mapping)
Verifies whether an index mapping exists. |
any
|
onDIComplete()
After init the autowire properties. |
Document
|
save(Document document)
|
array
|
saveAll(array documents)
Persists multiple items to the index. |
any
|
setNativeClient(any nativeClient)
|
any
|
setWirebox(any wirebox)
|
boolean
|
updateByQuery(SearchBuilder searchBuilder, struct script)
updates documents from a query. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
Properties created on init()
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod 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 mappings to an index
indexName
- string the index containing the mappingsmappings
- struct the struct representation of the mappingsPool close method
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 )Delete documents from a query
searchBuilder
- SearchBuilder The assemble search builder 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 )Deletes an index type
indexName
- string the name of the index to be deletedtype
- type the index typing to be deletedExecute 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 typeProvider for Config object
Gets 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 typeProvider for search builder
Verifies 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 mappingAfter init the autowire properties
document
- Document@cbElasticSearch An instance of the elasticsearch Document objectPersists multiple items to the index
documents
- array An array of elasticsearch Document objects to persistnativeClient
wirebox
updates documents from a query
searchBuilder
- SearchBuilder The assemble search builder to use for the queryscript
- struct script to process on the query