lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten F." <>
Subject faces paging (numFacetFound) - need advice for programming
Date Fri, 19 Jun 2009 15:13:56 GMT


Some questions about an integer with numFacetFound for facets in solr. 

I already posted this message to solr – user, but possible I shouldn't have
reactivated a thread from 2008 ;-)

Our application "tecfinder" has a faceted browsing with paging for each
(see "Fachgebiete" in
Currently I am integrating solr in "tecfinder". So I need the number of
terms that have a non zero count. 
e.g. if I search with 
we need something like numFacetFound=19 for field LG (see "totalAmount" in
example below).

I know that I am not the first person who need this value, but I am willing
to program it myself.

To program an addition for SimpleFacets should be easy, 
because I only have to change three methods: 
 - getFacetTermEnumCounts (with respect to the line "if (--lim<0) break;") 
 - getFieldCacheCounts (count non zero values of "int[] counts") 
 - UnInvertedField.getCounts (again "int[] counts") 

It will not be easy to change DistribFieldFacet, but I hope this can wait
("This API is experimental and subject to change"). 

So my questions: 
Is there already an "numFacetFound" addition programed for solr? 
Did I miss something? Is there more to change then this three methods? 

What is an accurate place to expand the response with "numFacetFound"? 
(Should I derive a subclass "SubList" or "OffsetList" of NamedList with an
attribute "totalAmount"). 

Any advice is welcome 


p.s. the example for 

<result name="response" numFound="18614" start="0"> 
<lst name="facet_counts"> 
  <lst name="facet_queries"/> 
    <lst name="facet_fields"> 
      <lst name="LG" totalAmount="19" offset="0"> 
        <int name="ru">592</int> 
        <int name="fr">191</int> 
        <int name="ja">82</int> 
        <int name="pl">32</int> 
  <lst name="facet_dates"/> 
View this message in context:
Sent from the Solr - Dev mailing list archive at

View raw message