suggest
searches against completion fields with a synonym set result in null pointer exceptions
#114651
Labels
>bug
priority:normal
A label for assessing bug priority to be used by ES engineers
:Search Relevance/Suggesters
"Did you mean" and suggestions as you type
Team:Search Relevance
Meta label for the Search Relevance team in Elasticsearch
Elasticsearch Version
8.13.2
Installed Plugins
No response
Java Version
bundled
OS Version
Elastic Cloud
Problem Description
When performing a
suggest
search against acompletion
field whosesearch_analyzer
contains asynonym_set
, Elasticsearch returns a500
response with a null pointer exception.This behavior does not occur when using inline synonyms, or
synonym_path
, and thesynonym_set
behaves as expected when using the_analyze
endpoint.Expected:
suggest
searches on completion fields that utilize a synonym set return a non-error response, and the suggest prefix is correctly tokenized according to the rules of the synonym set.Actual: a
500
response is returned, with anull_pointer_exception
and a reason ofCannot invoke "org.elasticsearch.index.analysis.AnalyzerComponents.getCharFilters()" because "components" is null
Steps to Reproduce
Create a synonym set with an arbitrary number of synonyms ranging from 0 -
n
.Create an index with the following details:
synonym
orsynonym_graph
"updateable": "true"
synonym_set
using the name of the previously created synonym setfilter
with the previously created filtercompletion
field containing:search_analyzer
using the name of the previously created analyzerCreate a document in this index with an arbitrary value for the previously created completion field
Make a request to the
_search
endpoint of the index using asuggest
query with an arbitraryprefix
The following should produce a working example of the issue:
It is worth noting that during index creation, if the synonym filter is created using in-line or
synonyms_path
, andupdateable
is omitted, thesuggest
search will work as expected:Logs (if relevant)
The exact error response from Elastic is as follows:
The text was updated successfully, but these errors were encountered: