@@ -329,7 +329,8 @@ public void setRelevance(double relevance) {
329329 * summaries. This also enables tracking of which summary classes
330330 * have been used for filling so far. Invoking this method
331331 * multiple times is allowed and will have no addition
332- * effect. Note that a fillable hit may not be made unfillable.
332+ * effect. Call setUnfillable() if there is no more data fill()
333+ * can obtain for that hit.
333334 */
334335 public void setFillable () {
335336 if (filled == null ) {
@@ -339,6 +340,14 @@ public void setFillable() {
339340 }
340341 }
341342
343+ /**
344+ * Tag this hit as no longer fillable.
345+ */
346+ public void setUnfillable () {
347+ filled = null ;
348+ unmodifiableFilled = null ;
349+ }
350+
342351 /**
343352 * Register that this hit has been filled with properties using
344353 * the given summary class. Note that this method will implicitly
@@ -354,7 +363,6 @@ public void setFilled(String summaryClass) {
354363 } else if (filled .size () == 1 ) {
355364 filled = new HashSet <>(filled );
356365 unmodifiableFilled = Collections .unmodifiableSet (filled );
357-
358366 filled .add (summaryClass );
359367 } else {
360368 filled .add (summaryClass );
@@ -600,7 +608,7 @@ public Object getSearcherSpecificMetaData(Searcher searcher) {
600608
601609 final void setFilledInternal (Set <String > filled ) {
602610 this .filled = filled ;
603- unmodifiableFilled = (filled != null ) ? Collections .unmodifiableSet (filled ) : null ;
611+ unmodifiableFilled = (filled == null ) ? null : Collections .unmodifiableSet (filled );
604612 }
605613
606614 /**
0 commit comments