Fork me on GitHub

Elastic Index

Oak supports Elasticsearch (Elastic for short) based indexes for both property constraint and full text constraints. Elastic indexes support similar features as Lucene indexes, however there are differences:

  • The type is elasticsearch.
  • The index definition needs to be under /oak:index. Other locations are not supported.
  • The async property needs to be set to elastic-async. Synchronous, nrt or other lanes are not supported. Indexes are updated asynchronously.
  • refresh is ignored. Changes take effect immediately after changing them. Existing documents in Elasticsearch are not changed.
  • Indexes are NOT automatically built when needed: They can be built by setting the reindex property to true or by using the oak-run tool. We recommend to build them using the oak-run tool.
  • evaluatePathRestrictions is only checked at query time (to keep the compatibility with Lucene). The parent paths are always indexed. Changing this flag won't require a reindex then. It's strongly suggested to enable it. This control might be removed in the future.
  • codec is ignored.
  • compatVersion is ignored.
  • useIfExists is ignored.
  • blobSize is ignored.
  • name is ignored.
  • indexPath is ignored.
  • If the composite node store is used, Elastic indexes only index the writable part of the repository. It is best to use queryPaths and includedPaths to ensure the index is only used for the right queries.
  • analyzers is ignored, except for indexOriginalTerm. Due to that, synonyms, stemming (PorterStem), filters (LowerCase), and stopwords are not supported.
  • useInExcerpt does not support regexp relative properties.
  • For property definitions, sync and unique are ignored. Synchronous indexing, and enforcing uniqueness constraints is not currently supported in elastic indexes.
  • The behavior for dynamicBoost is slightly different: For Lucene indexes, boosting is done in indexing, while for Elastic it is done at query time.
  • The behavior for suggest is slightly different: For Lucene indexes, the suggestor is updated every 10 minutes by default and the frequency can be changed by suggestUpdateFrequencyMinutes property in suggestion node under the index definition node. In Elastic indexes, there is no such delay and thus no need for the above config property. This is an improvement in ES over lucene.