FAQ
Hi

Is it possible to count the total number of documents in the index
without requesting a search? I would like to count the total documents
in the index within a date range.

Thanks,
Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Erik Hatcher at Aug 7, 2005 at 3:06 pm
    You've asked to different questions - you can use IndexReader.numDocs
    () to find the total number of documents.

    Within a date range - how did you index the dates? If the dates are
    in lexicographical order, you can walk all the terms in that range
    using TermEnum from IndexReader.terms(Term t) where t is the first
    term in the date range. You will then need to get the termDocs(t)
    for each of the matching terms. So it is possible without a search.

    Erik

    On Aug 7, 2005, at 7:47 AM, Ben wrote:

    Hi

    Is it possible to count the total number of documents in the index
    without requesting a search? I would like to count the total documents
    in the index within a date range.

    Thanks,
    Ben

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedAug 7, '05 at 11:47a
activeAug 7, '05 at 3:06p
posts2
users2
websitelucene.apache.org

2 users in discussion

Ben: 1 post Erik Hatcher: 1 post

People

Translate

site design / logo © 2022 Grokbase