You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jigar Shah <ji...@gmail.com> on 2014/09/26 08:57:20 UTC

min/max values of numeric facets

Hello Lucene group,

*Taxonomy facet Indexing code:*

Document doc=...
Set<Field> facets=...;
for(int i =0; i < ... ; i++) {
    long wordCount = ...
    NumericDocValuesField nf = new NumericDocValuesField(queryName,
wordCount);
    facets.add(nf);
}
doc.add(facets);
FacetsConfig config=...
trackingIndexWriter.addDocument(config.build(taxoWriter, doc))

*Faceted search code:*

LongRange longRanges...; *Note: Client needs to predict range. To get
counts in specified ranges.*
Facets wordCountFacets = new LongRangeFacetCounts("wordCount",collector,
longRanges);
multiFacets.put("wordCount", wordCountFacets);
FacetResult facetResult = multiFacets.getTopChildren(ranges.size(),
"wordCount");

Above this work's fine But i need to provide min/max of wordCount facet. So
client can predict ranges in a better way.

Is it possible to get min/max of numeric facet, along with counts in the
specified ranges ?


Thanks,
Jigar Shah.