: Scorer scorer = : query.weight(indexSearcher).scorer(indexSearcher.getIndexReader());
You'd need to rewrite the query first to be safe. A slightly higher level API approach would be a HitCollector that just counts the hits... http://lucene.apache.org/java/docs/api/org/apache/lucene/search/HitCollector.html Searcher searcher = new IndexSearcher(indexReader); final int[] count = new int[0]; // use array container since need final searcher.search(query, new HitCollector() { public void collect(int doc, float score) { count[0]++; } }); System.out.println("count of matches: " + count[0]): -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]