CoreTermSearchFacetResult.terms() returns null if field is absent from all documents

Description

Suggested Release Note:

Accessing the terms of a `TermFacet` result no longer throws NullPointerException if the target field is absent from all documents.

 

In Java, this surfaces as a NullPointerException when calling `TermSearchFacetResult.terms()`, as in this reproducer:

 

 

It's worse in Kotlin, where the results are converted eagerly; Kotlin gets an NPE inside `searchQuery`, before the user even touches the facet results.

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Sprint

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 25, 2024 at 11:31 PM
Updated January 26, 2024 at 5:48 PM
Resolved January 26, 2024 at 5:48 PM
Instabug