Skip to content

[9.3] Fix NPE when querying pattern_text field#143113

Merged
parkertimmins merged 1 commit intoelastic:9.3from
parkertimmins:parker/backport-pattern-text-npe-9.3
Feb 26, 2026
Merged

[9.3] Fix NPE when querying pattern_text field#143113
parkertimmins merged 1 commit intoelastic:9.3from
parkertimmins:parker/backport-pattern-text-npe-9.3

Conversation

@parkertimmins
Copy link
Copy Markdown
Contributor

Targeted backport of #142767 to 9.3. Fixes three bugs:

  1. Empty segment NPE when PatternTextCompositeValues.from() returns null in valueFetcher and PatternTextIndexFieldData.
  2. Disabled templating NPE where valueFetcher and PatternTextIndexFieldData called CompositeValues.from() which always returns null without template_id values.
  3. BytesRef hex output in getValueFetcherProvider where SourceIntervalsSource received raw BytesRef instead of String, causing intervals queries to never match.

#142767 was built on top of the changes from #140191, #140939, and #142051. Since these were not backported, a single backport of #142767 onto 9.3 would be difficult. For this reason, I chose to make the same bug fixes from #142767 directly on 9.3 (without the other refactors).

Targeted backport of elastic#142767 to 9.3. Fixes three bugs:

1. Empty segment NPE when PatternTextCompositeValues.from()
   returns null in valueFetcher and PatternTextIndexFieldData.
2. Disabled templating NPE where valueFetcher and
   PatternTextIndexFieldData called CompositeValues.from()
   which always returns null without template_id values.
3. BytesRef hex output in getValueFetcherProvider where
   SourceIntervalsSource received raw BytesRef instead of
   String, causing intervals queries to never match.
@parkertimmins parkertimmins changed the title Fix NPE when querying pattern_text field [9.3] Fix NPE when querying pattern_text field Feb 25, 2026
Copy link
Copy Markdown
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@parkertimmins parkertimmins marked this pull request as ready for review February 26, 2026 16:34
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Feb 26, 2026
@parkertimmins parkertimmins added backport :StorageEngine/Mapping The storage related side of mappings and removed needs:triage Requires assignment of a team area label labels Feb 26, 2026
@parkertimmins parkertimmins merged commit c847da5 into elastic:9.3 Feb 26, 2026
35 checks passed
@parkertimmins parkertimmins deleted the parker/backport-pattern-text-npe-9.3 branch February 26, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :StorageEngine/Mapping The storage related side of mappings v9.3.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants