Fix match_only_text bugs if defined as multi-field#130188
Fix match_only_text bugs if defined as multi-field#130188martijnvg merged 8 commits intoelastic:mainfrom
Conversation
Bugs starting to occur when elastic#129126 was merged. Closes elastic#129737
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
| if (searchExecutionContext.isSourceSynthetic()) { | ||
| if (searchExecutionContext.isSourceSynthetic() && withinMultiField == false && hasCompatibleMultiFields == false) { | ||
| String name = storedFieldNameForSyntheticSource(); | ||
| // TODO: go the parent field and load either via stored fields or doc values the values instead synthesizing complete source |
There was a problem hiding this comment.
| // TODO: go the parent field and load either via stored fields or doc values the values instead synthesizing complete source | |
| // TODO: go the parent field and load either via stored fields or doc values, instead of synthesizing the complete source. |
| if (searchExecutionContext.isSourceSynthetic() && withinMultiField == false && hasCompatibleMultiFields == false) { | ||
| String name = storedFieldNameForSyntheticSource(); | ||
| // TODO: go the parent field and load either via stored fields or doc values the values instead synthesizing complete source | ||
| // (in case of synthetic source and if this field is a multi field, then it will not have a stored field.) |
There was a problem hiding this comment.
| // (in case of synthetic source and if this field is a multi field, then it will not have a stored field.) | |
| // In case of synthetic source and if this field is a multi field, then it will not have a stored field. |
| ); | ||
| } | ||
| if (searchExecutionContext.isSourceSynthetic()) { | ||
| if (searchExecutionContext.isSourceSynthetic() && withinMultiField == false && hasCompatibleMultiFields == false) { |
There was a problem hiding this comment.
Nit: these two variables are only used here? If so, replace them with one?
There was a problem hiding this comment.
This is actually for the follow up. When there is a keyword multi field then doc values or stored field of the multi field is used, otherwise if stored field / doc values of parent keyword field is used.
| if (searchExecutionContext.isSourceSynthetic()) { | ||
| if (searchExecutionContext.isSourceSynthetic() && withinMultiField == false && hasCompatibleMultiFields == false) { | ||
| String name = storedFieldNameForSyntheticSource(); | ||
| // TODO: go the parent field and load either via stored fields or doc values the values instead synthesizing complete source |
There was a problem hiding this comment.
Does this comment belong to the next block that invokes SourceProvider?
There was a problem hiding this comment.
Yes, the values would be loaded via source provider, which is slow. I will fix this.
| } | ||
| ); | ||
| } else { | ||
| var kwd = TextFieldMapper.SyntheticSourceHelper.getKeywordFieldMapperForSyntheticSource(this); |
There was a problem hiding this comment.
Is keyword the only multifield combination with match_only_text?
There was a problem hiding this comment.
Yes, in other cases the match_only_text field will be stored.
kkrik-es
left a comment
There was a problem hiding this comment.
A few comments, but approving to get you going.
…tored field or doc values of parent keyword field or stored field or doc values of multi field.
* Fix match_only_text bugs if defined as multi-field Bugs starting to occur when elastic#129126 was merged. Closes elastic#129737
💔 Backport failed
You can use sqren/backport to manually backport by running |
Backporting elastic#130188 to 8.19 branch. Bugs starting to occur when elastic#129126 was merged. Closes elastic#129737
* Fix match_only_text bugs if defined as multi-field Bugs starting to occur when elastic#129126 was merged. Closes elastic#129737
Bugs starting to occur when #129126 was merged.
Closes #129737
This is a bug, but marking as non-issue. Given that it has not been released in a stateful release.