Don't expose TextFieldMapper subfields#64597
Merged
romseygeek merged 37 commits intoelastic:masterfrom Nov 5, 2020
Merged
Conversation
…apper/indexanalyzer
Collaborator
|
Pinging @elastic/es-search (:Search/Mapping) |
Contributor
Author
|
I've marked this as |
jtibshirani
approved these changes
Nov 4, 2020
Contributor
jtibshirani
left a comment
There was a problem hiding this comment.
This makes sense to me!
| } | ||
|
|
||
| private PrefixFieldMapper buildPrefixMapper(BuilderContext context, FieldType fieldType, TextFieldType tft) { | ||
| private SubFieldInfo buildPrefixMapper(BuilderContext context, FieldType fieldType, TextFieldType tft) { |
Contributor
There was a problem hiding this comment.
buildPrefixMapper -> buildPrefixInfo
| TextFieldType tft = buildFieldType(fieldType, context); | ||
| PhraseFieldMapper phraseFieldMapper = buildPhraseMapper(fieldType, tft); | ||
| PrefixFieldMapper prefixFieldMapper = buildPrefixMapper(context, fieldType, tft); | ||
| SubFieldInfo phraseFieldMapper = buildPhraseInfo(fieldType, tft); |
Contributor
There was a problem hiding this comment.
We could switch to the *Info naming here too,
romseygeek
added a commit
that referenced
this pull request
Nov 5, 2020
TextFieldMapper can optionally index data into subfields for accelerated prefix and phrase queries. Currently, these subfields are implemented as FieldMappers in their own right, made available via TextFieldMapper's iterator() method and with their own standalone MappedFieldType objects. This has the disadvantage that these subfields are directly available for searching, and appear in APIs such as field caps. In addition, because exists queries are not implemented on them, an exists query against an object which contains a text field with one of the subfields enabled can throw an error (see #63585). This commit reworks the subfields so that they are no longer implemented as FieldMappers, and are no longer exposed to classes outside TextFieldMapper either as MappedFieldTypes or as FieldMappers. The parent TextFieldMapper handles indexing and analyzer registration, PhraseFieldType is removed entirely, and PrefixFieldType is retained as a private implementation for fast prefix queries but is unavailable for querying directly. Fixes #63585 Closes #63446
romseygeek
added a commit
to romseygeek/elasticsearch
that referenced
this pull request
Jan 13, 2021
romseygeek
added a commit
that referenced
this pull request
Jan 13, 2021
romseygeek
added a commit
that referenced
this pull request
Jan 13, 2021
80 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TextFieldMapper can optionally index data into subfields for accelerated
prefix and phrase queries. Currently, these subfields are implemented
as FieldMappers in their own right, made available via TextFieldMapper's
iterator() method and with their own standalone MappedFieldType objects.
This has the disadvantage that these subfields are directly available for
searching, and appear in APIs such as field caps. In addition, because
exists queries are not implemented on them, an exists query against an
object which contains a text field with one of the subfields enabled can
throw an error (see #63585).
This commit reworks the subfields so that they are no longer implemented
as FieldMappers, and are no longer exposed to classes outside
TextFieldMapper either as MappedFieldTypes or as FieldMappers. The
parent TextFieldMapper handles indexing and analyzer registration,
PhraseFieldType is removed entirely, and PrefixFieldType is retained as
a private implementation for fast prefix queries but is unavailable for
querying directly.
Fixes #63585
Closes #63446
Closes #64585