Hi-

I'm trying to use the LukeRequestHandler with an index of ~9 million
docs.  I know that counting the top / distinct terms for each field is
expensive and can take a LONG time to return.

Is there a faster way to check the number of documents for each field?
 Currently this gets the doc count for each term:

      if( sfield != null && sfield.indexed() ) {
        Query q = qp.parse( fieldName+":[* TO *]" );
        int docCount = searcher.numDocs( q, matchAllDocs );
        ...

Looking at it again, that could be replaced with:

      if( sfield != null && sfield.indexed() ) {
        Query q = qp.parse( fieldName+":[* TO *]" );
        int docCount = searcher.getDocSet( q ).size();
        ...

Is there any faster option then running a query for each field?

thanks
ryan

Reply via email to