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
|
jLoader
|
true
|
false
|
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. |
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()
|
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)
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. |
private any
|
execute(any action, [any returnObject='false'])
Executes an HTTP client transaction. |
SearchResult
|
executeSearch(SearchBuilder searchBuilder)
Execute a client search request. |
any
|
get(any id, [string index], [string type])
Retrieves a document by ID. |
Config
|
getConfig()
Config provider. |
string
|
getHTTPClient()
|
string
|
getJLoader()
|
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
|
newDocument()
Document provider. |
Document
|
newResult()
SearchResult provider. |
any
|
onDIComplete()
Configure instance once DI is complete. |
Document
|
save(Document document)
|
array
|
saveAll(array documents)
Persists multiple items to the index. |
any
|
setHTTPClient(any HTTPClient)
|
any
|
setJLoader(any jLoader)
|
boolean
|
updateByQuery(SearchBuilder searchBuilder, struct script)
Updates items in the index by query. |
Methods inherited from class lucee.Component |
---|
None |
Property Detail |
---|
The HTTP Jest Client
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- loader@cbjavaloaderserializable
- trueMethod Detail |
---|
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
Deletes 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 queryDeletes 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 objectRetrieves a document by ID
get
in interface
iNativeClient
id
- any The document keyindex
- string The name of the indextype
- type The name of the typeConfig provider
Gets 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 typeVerifies 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 mappingDocument provider
SearchResult provider
Configure instance once DI is complete
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 persistHTTPClient
jLoader
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 query