Michael Born
Web developer at Ortus Solutions
highlights from the last year of development
var search = searchBuilder.filterTerm( "author", "Michael Borne" );
client.updateByQuery( search, {
"script" : "ctx._source.author.name = 'Michael Born'",
"lang" : "painless"
});
var client = getInstance( "Client@cbElasticsearch" );
var aliasBuilder = getInstance( "AliasBuilder@cbElasticSearch" );
// "pour" book documents into new library index
client.reindex( "books", "library" );
// create an alias of the old index name so no code errors out
client.applyAliases(
aliasBuilder.add( "library", "books" )
);
var reindex = getInstance( "Client@cbElasticsearch" )
.reindex(
source = "books",
destination = "library",
waitForCompletion = false
);
while( !reindex.isComplete( delay=5000 ) ){
var status = reindex.getStatus();
writeOutput(
"<p>Created #status.created# documents of #status.total#</p>"
);
flush();
}
var search = getInstance( "SearchBuilder@cbElasticsearch" )
.suggestTerm( "Carl Perlins", "artistName" )
.execute();
var search = getInstance( "SearchBuilder@cbElasticsearch" )
.suggestCompletion( "Is Elvis still", "artistName" )
.execute();
The future roadmap
We can improve asynchronous operations by integrating with ColdBox 6 futures
var client = getInstance( "Client@cbElasticsearch" );
client.saveAll(
documents = persons,
asFuture = true
).then( () => {
getLogBox().getRootLogger().info( "Finished indexing documents" );
});
By Michael Born
An ITB 2020 keynote session outlining history and roadmap for CBElasticsearch