lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lothar Simon" <lothar.si...@eidon.de>
Subject Determine number of entries for a certain key
Date Thu, 20 Jun 2002 15:50:17 GMT
What is the easiest way to determine the number of (not deleted) terms in an
(not optimized) index when the KEY string is known? Each indexed document
has a KEY and a CONTENTS field. One of my approaches was:

    Searcher searcher = new IndexSearcher(this.indexworkdir);
    Query query = QueryParser.parse(key, FULLTEXT_KEY_FIELD, analyzer);
    int count = searcher.search(query).length();
    searcher.close();

This does not find anything: for existing keys always count=0 (though
searches in the CONTENTS field work perfectly). In addition, I tried
IndexReader and TermDocs, then IndexReader and docFreq... No success.



--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message