Revision 3bd594ebe86044c9b8280b75d68f7fe73512aacf authored by Alan Woodward on 13 May 2021, 10:35:23 UTC, committed by GitHub on 13 May 2021, 10:35:23 UTC
MappingLookup has a method simpleMatchToFieldName that attempts
to return all field names that match a given pattern; if no patterns match,
then it returns a single-valued collection containing just the pattern that
was originally passed in. This is a fairly confusing semantic.

This PR replaces simpleMatchToFullName with two new methods:

* getMatchingFieldNames(), which returns a set of all mapped field names
  that match a pattern. Calling getFieldType() with a name returned by
  this method is guaranteed to return a non-null MappedFieldType
* getMatchingFieldTypes, that returns a collection of all MappedFieldTypes
  in a mapping that match the passed-in pattern.

This allows us to clean up several call-sites because we know that
MappedFieldTypes returned from these calls will never be null. It also
simplifies object field exists query construction.
1 parent a5e39ce
History
File Mode Size
.ci
.github
.idea
benchmarks
buildSrc
client
dev-tools
distribution
docs
gradle
libs
licenses
modules
plugins
qa
rest-api-spec
server
test
x-pack
.dir-locals.el -rw-r--r-- 3.3 KB
.editorconfig -rw-r--r-- 419 bytes
.gitattributes -rw-r--r-- 32 bytes
.gitignore -rw-r--r-- 1.2 KB
CONTRIBUTING.md -rw-r--r-- 36.8 KB
LICENSE.txt -rw-r--r-- 546 bytes
NOTICE.txt -rw-r--r-- 228 bytes
README.asciidoc -rw-r--r-- 2.6 KB
TESTING.asciidoc -rw-r--r-- 32.5 KB
Vagrantfile -rw-r--r-- 14.9 KB
build.gradle -rw-r--r-- 21.2 KB
gradle.properties -rw-r--r-- 876 bytes
gradlew -rwxr-xr-x 5.6 KB
gradlew.bat -rw-r--r-- 2.7 KB
settings.gradle -rw-r--r-- 4.4 KB

README.asciidoc

back to top