BoxLang 🚀 A New JVM Dynamic Language Learn More...
This is an extension for the Preside Platform that provides APIs and a methodology for integrating full-text search with ElasticSearch.
From the webroot of your application:
box install preside-ext-elasticsearch
A single release of the extension supports multiple ElasticSearch engine versions. Set the version of the engine you are using, either with an environment variable:
ELASTICSEARCH_VERSION=1.7
or in your application's Config.cfc:
settings.elasticSearchConfig.engineVersion = "1.7";
The default is 6.3, although we recommend the version be
explicitly set, to avoid potential upgrade issues. Currently supported versions:
| Version | Dialect | Notes |
|---|---|---|
1.7
| Es1Dialect
| One mapping per document type. query_string
searches. The fuzziness and
prefixLength search arguments are ignored. |
6.3
| Es6Dialect
| A single doc mapping, with the document type
stored in a type keyword field.
multi_match searches. |
The extension uses the dialect registered for the highest version
that is less than or equal to the configured version, so
6.8 uses the 6.3 dialect. The admin search
engine page shows the configured version next to the version reported
by the server, and warns when their major versions differ.
Changing the engine version requires an application reload, followed by a rebuild of your search indexes.
Everything that differs between engine versions lives in a
"dialect" component in services/dialects/. To
support a new version:
Es7Dialect extends Es6Dialect), overriding only what
has changed.config/Config.cfc
(settings.elasticSearchConfig.dialects[ "7.10" ] =
"Es7Dialect"). Applications can also register their
own dialects using a full component path.Setting (settings.elasticSearchConfig.*) |
Default | Description |
|---|---|---|
indexPageSize
| 100
| Number of records sent to ElasticSearch in each batch when rebuilding an index. |
searchPageSize
| 10
| Default page size for search(). |
groupByRecordIdOnly
| false
| Group by the record ID instead of using Preside's
autoGroupBy when fetching records for indexing. |
indexExpiryUnit / indexExpiryMeasure
| d / 1
| How long an index rebuild can run before it is considered to have timed out. |
The extension also adds a scheduled task, Rebuild search indexes, which runs daily at 4am.
Documentation is a work in progress. For now, we intend to use the Github Wiki and could do with all the help we can get. Contributions very welcome!
We use SemVer for versioning. As of 7.0, the extension is universal and covers multiple versions of ElasticSearch. For the versions available, see the tags on this repository. Project releases can also be found and installed from Forgebox
This project is licensed under the GPLv2 License - see the LICENSE.txt file for details.
The project is maintained by The Pixl8 Group. The lead developer is Dominic Watson.
We are a small, friendly and professional community. For the eradication of doubt, we publish a simple code of conduct and expect all contributors, users and passers-by to observe it.
$
box install preside-ext-elasticsearch