lucee.Componentcbelasticsearch.JestClient
Elasticsearch JEST Native Client https://github.com/searchbox-io/Jest
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
HTTPClient
The HTTP Jest Client.
|
true
|
false
|
|
any
|
instanceConfig
Instance configuration object.
|
true
|
false
|
|
any
|
jLoader
|
true
|
false
|
|
any
|
log
|
true
|
false
|
|
any
|
util
Utility object.
|
true
|
false
|
|
any
|
versionTarget
The Elasticsearch version target for this client.
|
true
|
false
|
Constructor Summary | |
---|---|
init([Config configuration])
|
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 multiple mappings to an index. |
private any
|
buildDeleteAction(Document document)
|
private any
|
buildUpdateAction(Document document)
|
void
|
close()
Closes any connections to the pool and destroys the client singleton. |
void
|
configure([Config configuration])
|
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. |
any
|
execute(any action, [any returnObject='false'])
Executes an HTTP client transaction. |
SearchResult
|
executeSearch(SearchBuilder searchBuilder)
Execute a client search request. |
private any
|
generateIndexMap(any index)
|
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. |
Config
|
getConfig()
Config provider. |
string
|
getHTTPClient()
|
struct
|
getIndices([any verbose='false'])
Returns a struct containing all indices in the system, with statistics. |
string
|
getInstanceConfig()
|
string
|
getJLoader()
|
string
|
getLog()
|
array
|
getMultiple(array keys, [string index], [string type])
Gets multiple items when provided an array of keys. |
any
|
getTask(string taskId, [Task taskObj='[runtime expression]'])
Retreives a task and its status. |
any
|
getTasks()
Retreives all tasks running on the cluster. |
cbelasticsearch.Util
|
getUtil()
Util provider. |
string
|
getVersionTarget()
|
boolean
|
indexExists(string indexName)
Verifies whether an index exists. |
boolean
|
indexMappingExists(string indexName, string mapping)
Verifies whether an index mapping exists. |
private boolean
|
isMajorVersion(numeric versionNumber)
Returns a boolean as to whether the target version matches a major version. |
SearchBuilder
|
newBuilder()
SearchBuilder provider. |
Document
|
newDocument()
Document provider. |
SearchResult
|
newResult()
SearchResult provider. |
Task
|
newTask()
Task provider. |
any
|
onDIComplete()
Configure instance once DI is complete. |
array
|
parseParams(any params)
Parses a parameter argument. |
any
|
reindex(any source, any destination, [boolean waitForCompletion='true'], [any params], [any script])
Applies a reindex action. |
Document
|
save(Document document)
|
array
|
saveAll(array documents, [boolean throwOnError='false'])
Persists multiple items to the index. |
any
|
setHTTPClient(any HTTPClient)
|
any
|
setInstanceConfig(any instanceConfig)
|
any
|
setJLoader(any jLoader)
|
any
|
setLog(any log)
|
any
|
setUtil(any util)
|
any
|
setVersionTarget(any versionTarget)
|
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 |
---|
configuration
Property Detail |
---|
The HTTP Jest Client
access
- publicrequired
- falsereturntype
- anyserializable
- trueInstance configuration object
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- loader@cbjavaloaderserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:{this}serializable
- trueUtility object
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe Elasticsearch version target for this client
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Applies an alias (or array of aliases)
applyAliases
in interface
iNativeClient
aliases
- AliasBuilder An AliasBuilder instance (or array of instances)Applies an index item ( create/update )
applyIndex
in interface
iNativeClient
indexBuilder
- IndexBuilder An instance of the IndexBuilder objectApplies a single mapping to an index
applyMapping
in interface
iNativeClient
indexName
- string the name of the indexmappingName
- string the name of the mappingmappingConfig
- struct the mapping configuration structApplies multiple mappings to an index
applyMappings
in interface
iNativeClient
indexName
- string The name of the indexmappings
- struct a struct containing the mapping configurationdocument
document
Closes any connections to the pool and destroys the client singleton
close
in interface
iNativeClient
configuration
Retreives a count of documents matching the given query
count
in interface
iNativeClient
searchBuilder
- [SearchBuilder] An instance of the SearchBuilder objectDeletes a single document
delete
in interface
iNativeClient
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
deleteAll
in interface
iNativeClient
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
deleteByQuery
in interface
iNativeClient
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
deleteIndex
in interface
iNativeClient
indexName
- string the name of the index to be deletedDeletes a mapping
deleteMapping
in interface
iNativeClient
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 )Executes an HTTP client transaction
action
- any A valid Jest client actionreturnObject
- boolean Whether to return the JestResult, default to false, which returns a structExecute a client search request
executeSearch
in interface
iNativeClient
searchBuilder
- SearchBuilder An instance of the SearchBuilder objectindex
Retrieves a document by ID
get
in interface
iNativeClient
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
getAliases
in interface
iNativeClient
Config provider
Returns a struct containing all indices in the system, with statistics
getIndices
in interface
iNativeClient
verbose
- boolean whether to return the full stats output for the indexGets multiple items when provided an array of keys
getMultiple
in interface
iNativeClient
keys
- array An array of keys to retrieveindex
- string The name of the indextype
- type The name of the typeRetreives a task and its status
getTask
in interface
iNativeClient
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
getTasks
in interface
iNativeClient
Util provider
Verifies whether an index exists
indexExists
in interface
iNativeClient
indexName
- string the name of the indexVerifies whether an index mapping exists
indexMappingExists
in interface
iNativeClient
indexName
- string the name of the indexmapping
- string the name of the mappingReturns a boolean as to whether the target version matches a major version
versionNumber
- trueSearchBuilder provider
Document provider
SearchResult provider
Task provider
Configure instance once DI is complete
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 } ]` )
parseParams
in interface
iNativeClient
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 } ]` )
reindex
in interface
iNativeClient
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
save
in interface
iNativeClient
document
- Document@cbElasticSearch An instance of the elasticsearch Document objectPersists multiple items to the index
saveAll
in interface
iNativeClient
documents
- array An array of elasticsearch Document objects to persistthrowOnError
- boolean Whether to throw an exception on error on individual documents which were not persistedHTTPClient
instanceConfig
jLoader
log
util
versionTarget
Updates items in the index by query
updateByQuery
in interface
iNativeClient
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