fix cleanup of of has child/parent
check if the collected uids were processed before trying to push them back to the cache
This commit is contained in:
parent
3cd54fc4ee
commit
7bf233a174
|
@ -140,7 +140,9 @@ public abstract class HasChildFilter extends Filter implements ScopePhase.Collec
|
|||
}
|
||||
|
||||
public void clear() {
|
||||
if (collectedUids != null) {
|
||||
CacheRecycler.pushHashSet(collectedUids);
|
||||
}
|
||||
collectedUids = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,10 @@ package org.elasticsearch.index.search.child;
|
|||
|
||||
import gnu.trove.set.hash.THashSet;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.search.*;
|
||||
import org.apache.lucene.search.Collector;
|
||||
import org.apache.lucene.search.DocIdSet;
|
||||
import org.apache.lucene.search.Filter;
|
||||
import org.apache.lucene.search.Query;
|
||||
import org.apache.lucene.util.FixedBitSet;
|
||||
import org.elasticsearch.ElasticSearchIllegalStateException;
|
||||
import org.elasticsearch.common.CacheRecycler;
|
||||
|
@ -107,7 +110,9 @@ public abstract class HasParentFilter extends Filter implements ScopePhase.Colle
|
|||
}
|
||||
|
||||
public void clear() {
|
||||
if (parents != null) {
|
||||
CacheRecycler.pushHashSet(parents);
|
||||
}
|
||||
parents = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue