mirror of https://github.com/apache/lucene.git
SOLR-11553: fix refinement to pick right processor / uninversion mechanism
This commit is contained in:
parent
96af869da3
commit
c561ffe635
|
@ -110,6 +110,9 @@ Bug Fixes
|
|||
* SOLR-11231: Guard against unset fields when performing language detection.
|
||||
(Chris Beer via Steve Rowe)
|
||||
|
||||
* SOLR-11553: JSON Facet API: facet refinement could use UIF in phase one and DV uninversion in phase 2, resulting
|
||||
in too much memory use. (yonik)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
* SOLR-11285: Refactor autoscaling framework to avoid direct references to Zookeeper and Solr
|
||||
|
|
|
@ -101,6 +101,11 @@ public class FacetField extends FacetRequestSorted {
|
|||
|
||||
if (fcontext.facetInfo != null) {
|
||||
// refinement... we will end up either skipping the entire facet, or doing calculating only specific facet buckets
|
||||
if (multiToken && !sf.hasDocValues() && method!=FacetMethod.DV) {
|
||||
// Match the access method from the first phase.
|
||||
// It won't always matter, but does currently for an all-values bucket
|
||||
return new FacetFieldProcessorByArrayUIF(fcontext, this, sf);
|
||||
}
|
||||
return new FacetFieldProcessorByArrayDV(fcontext, this, sf);
|
||||
}
|
||||
|
||||
|
|
|
@ -603,4 +603,16 @@ public class UnInvertedField extends DocTermOrds {
|
|||
|
||||
return uif;
|
||||
}
|
||||
|
||||
// Returns null if not already populated
|
||||
public static UnInvertedField checkUnInvertedField(String field, SolrIndexSearcher searcher) throws IOException {
|
||||
SolrCache<String, UnInvertedField> cache = searcher.getFieldValueCache();
|
||||
if (cache == null) {
|
||||
return null;
|
||||
}
|
||||
UnInvertedField uif = cache.get(field); // cache is already synchronized, so no extra sync needed
|
||||
// placeholder is an implementation detail, keep it hidden and return null if that is what we got
|
||||
return uif==uifPlaceholder ? null : uif;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue