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…
Reference in New Issue