Handle completion suggestion without contexts

This change fixes the handling of completion suggestion without contexts.

Relates #36996
This commit is contained in:
jimczi 2019-01-29 20:31:24 +01:00
parent f3f9cabd67
commit 193017672a
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}