Skip to content
master
Switch branches/tags
Code

Latest commit

…n a mapped type (#80286)

This change adds a ToScriptField class with the expectation it will be subclassed based on the 
needs of each mapped type to produce a DocValuesField used by the scripting fields api. This is 
intended to replace the more generic return of ScriptDocValues.

The change made here only targets classes implementing the LeafNumericFieldData interface to 
keep the initial change smaller, but is also an example for how this would work for other types of 
LeafFieldData as well.

It starts with the fielddataBuilder method of each MappedFieldType (where the appropriate 
subclass of ToScriptField is specified) then passes through the IndexFieldData.Builder to the 
IndexData.load method. From here the generated LeafFieldData uses the 
ToScriptField.getScriptField method to generate the appropriate type of DocValuesField as 
required by the new scripting fields api.

This design seems like the best way to meet the requirements for the scripting fields api by 
allowing enough information to pass all the way to the LeafFieldData, but without directly 
coupling the LeafFieldData to a mapped type so that the separation remains. There is also a 
precedent already set for this design in the keyword field family that uses a scriptFunction to 
generate a ScriptDocValues of the appropriate type. ToScriptField would eventually replace 
scriptFunction.
449d8e4

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time

Elasticsearch

Elasticsearch is the distributed, RESTful search and analytics engine at the heart of the Elastic Stack. You can use Elasticsearch to store, search, and manage data for:

  • Logs

  • Metrics

  • A search backend

  • Application monitoring

  • Endpoint security

... and more!

To learn more about Elasticsearch’s features and capabilities, see our product page.

Get started

The simplest way to set up Elasticsearch is to create a managed deployment with Elasticsearch Service on Elastic Cloud.

If you prefer to install and manage Elasticsearch yourself, you can download the latest version from elastic.co/downloads/elasticsearch.

For more installation options, see the Elasticsearch installation documentation.

Upgrade

To upgrade from an earlier version of Elasticsearch, see the Elasticsearch upgrade documentation.

Build from source

Elasticsearch uses Gradle for its build system.

To build a distribution for your local OS and print its output location upon completion, run:

./gradlew localDistro

To build a distribution for another platform, run the related command:

./gradlew :distribution:archives:linux-tar:assemble
./gradlew :distribution:archives:darwin-tar:assemble
./gradlew :distribution:archives:windows-zip:assemble

To build distributions for all supported platforms, run:

./gradlew assemble

Distributions are output to distributions/archives.

To run the test suite, see TESTING.

Documentation

For the complete Elasticsearch documentation visit elastic.co.

For information about our documentation processes, see the docs README.

Contribute

For contribution guidelines, see CONTRIBUTING.

Questions? Problems? Suggestions?

  • To report a bug or request a feature, create a GitHub Issue. Please ensure someone else hasn’t created an issue for the same topic.

  • Need help using Elasticsearch? Reach out on the Elastic Forum or Slack. A fellow community member or Elastic engineer will be happy to help you out.