mirror of https://github.com/apache/lucene.git
SOLR-10399: Generalize some internal facet logic to simplify points/non-points field handling
This commit is contained in:
parent
be2a1ea180
commit
62304383af
|
@ -184,6 +184,8 @@ Other Changes
|
|||
|
||||
* SOLR-10338: Configure SecureRandom non blocking for tests. (Mihaly Toth, hossman, Ishan Chattopadhyaya, via Mark Miller)
|
||||
|
||||
* SOLR-10399: Generalize some internal facet logic to simplify points/non-points field handling (Adrien Grand, hossman)
|
||||
|
||||
================== 6.5.0 ==================
|
||||
|
||||
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
||||
|
|
|
@ -851,18 +851,10 @@ public class SimpleFacets {
|
|||
SchemaField sf = searcher.getSchema().getField(field);
|
||||
FieldType ft = sf.getType();
|
||||
NamedList<Integer> res = new NamedList<>();
|
||||
if (ft.isPointField()) {
|
||||
for (String term : terms) {
|
||||
int count = searcher.numDocs(ft.getFieldQuery(null, sf, term), parsed.docs);
|
||||
res.add(term, count);
|
||||
}
|
||||
} else {
|
||||
for (String term : terms) {
|
||||
String internal = ft.toInternal(term);
|
||||
int count = searcher.numDocs(new TermQuery(new Term(field, internal)), parsed.docs);
|
||||
res.add(term, count);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue