mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Handle completion suggestion without contexts
This change fixes the handling of completion suggestion without contexts. Relates #36996
This commit is contained in:
parent
f3f9cabd67
commit
193017672a
@ -60,7 +60,9 @@ class TopSuggestGroupDocsCollector extends TopSuggestDocsCollector {
|
||||
int globalDoc = docID + docBase;
|
||||
boolean isNewDoc = docContexts.containsKey(globalDoc) == false;
|
||||
List<CharSequence> contexts = docContexts.computeIfAbsent(globalDoc, k -> new ArrayList<>());
|
||||
contexts.add(context);
|
||||
if (context != null) {
|
||||
contexts.add(context);
|
||||
}
|
||||
if (isNewDoc) {
|
||||
super.collect(docID, key, context, score);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user