lucene-solr-dev mailing list archives

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

Hi, 

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
facet 
(see "Fachgebiete" in 
http://tecfinder.fiz-technik.de/tecfinder/faces/facelets/search/search.jsp?query=Laser
). 
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 
facet=true&facet.field=LG&f.LG.facet.limit=4 
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.
(
http://www.nabble.com/Facet-Paging-to21437527.html
http://www.nabble.com/Facet-numFound-for-facet-values--td15769403.html
http://www.nabble.com/Count-of-facet-count-to16678811.html
)

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 

  Karsten 

p.s. the example for 
facet=true&facet.field=LG&f.LG.facet.limit=4 

<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> 
    </lst> 
  <lst name="facet_dates"/> 
</lst> 
</response> 
-- 
View this message in context: http://www.nabble.com/faces-paging-%28numFacetFound%29---need-advice-for-programming-tp24113413p24113413.html
Sent from the Solr - Dev mailing list archive at Nabble.com.


Mime
View raw message