Skip to content

Commit

Permalink
Handle completion suggestion without contexts
Browse files Browse the repository at this point in the history
This change fixes the handling of completion suggestion without contexts.

Relates #36996
  • Loading branch information
jimczi committed Jan 29, 2019
1 parent f3f9cab commit 1930176
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public void collect(int docID, CharSequence key, CharSequence context, float sco
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);
}
Expand Down

0 comments on commit 1930176

Please sign in to comment.