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
|
applyAliases(any aliases)
Applies an alias (or array of aliases). |
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. |
numeric
|
count([SearchBuilder searchBuilder])
Retreives a count of documents matching the given query. |
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. |
any
|
deleteByQuery(SearchBuilder searchBuilder, [boolean waitForCompletion='true'])
Deletes items in the index by 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. |
struct
|
getAliases()
Returns a struct containing the mappings of all aliases in the cluster. |
any
|
getConfig()
Provider for Config object. |
struct
|
getIndices([any verbose='false'])
Returns a struct containing all indices in the system, with statistics. |
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. |
any
|
getTask(string taskId, [Task taskObj])
Retreives a task and its status. |
any
|
getTasks()
Retreives all tasks running on the cluster. |
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. |
array
|
parseParams(any params)
Parses a parameter argument. |
any
|
reindex(any source, any destination, [boolean waitForCompletion='true'], [any params], [any script], [boolean throwOnError='true'])
Applies a reindex action. |
Document
|
save(Document document)
|
array
|
saveAll(array documents, [boolean throwOnError='false'])
Persists multiple items to the index. |
any
|
setNativeClient(any nativeClient)
|
any
|
setWirebox(any wirebox)
|
any
|
updateByQuery(SearchBuilder searchBuilder, struct script, [boolean waitForCompletion='true'])
Updates items in the index by 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 alias (or array of aliases)
aliases
- AliasBuilder An AliasBuilder instance (or array of instances)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
Retreives a count of documents matching the given query
searchBuilder
- SearchBuilder An instance of the SearchBuilder objectDeletes 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 querywaitForCompletion
- boolean Whether to block the request until completion or return a task which can be checkedDeletes 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 typeReturns a struct containing the mappings of all aliases in the cluster
Provider for Config object
Returns a struct containing all indices in the system, with statistics
verbose
- boolean whether to return the full stats output for the indexGets 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
Retreives a task and its status
taskId
- string The identifier of the task to retreivetaskObj
- Task The task object used for population - defaults to a new taskRetreives all tasks running on the cluster
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
Parses a parameter argument. upports multiple formats : `requests_per_second=50&slices=5`, `{ "requests_per_second" : 50, "slices" : 5 }`, or `[ { "name" : "requests_per_second", "value" : 50 } ]` )
params
- any the parameters to filter and transformApplies a reindex action Supports multiple formats : `requests_per_second=50&slices=5`, `{ "requests_per_second" : 50, "slices" : 5 }`, or `[ { "name" : "requests_per_second", "value" : 50 } ]` ) only used if `waitForCompletion` is `true`.
source
- string The source index name or struct of optionsdestination
- string The destination index name or struct of optionswaitForCompletion
- boolean Whether to return the result or an asynchronous taskparams
- any Additional url params to add to the reindex action.script
- any A script to run while reindexing.throwOnError
- boolean Whether to throw an exception if the reindexing fails. This flag isdocument
- Document@cbElasticSearch An instance of the elasticsearch Document objectPersists multiple items to the index
documents
- array An array of elasticsearch Document objects to persistthrowOnError
- boolean Whether to throw an exception on error on individual documents which were not persistednativeClient
wirebox
Updates items in the index by query
searchBuilder
- SearchBuilder The search builder object to use for the queryscript
- struct script to process on the querywaitForCompletion
- boolean Whether to block the request until completion or return a task which can be checked