I try 2 way for get count results: 1) Query q = .... IndexSearcher is = .... int count = Is.search(q).length();
2) Query q = .... IndexSearcher is = .... CountCollector collector = new CountCollector(); Is.search(q, collector); Int count = collector.getCount(); First way return results for 1.644 sec. Second way return results fot 3.088 sec. Why first way faster then second? Can I accelerate it? And how? Can you offer any ways for get number of results? ----------------------CountCollector import org.apache.lucene.search.HitCollector; /** * @author Anton Potekhin * @date: 03.03.2006 17:28:03 */ public class CountCollector extends HitCollector { private int numberRusults = 0; public int getCount() { return numberRusults; } public CountCollector() { } public void collect(int doc, float score) { if (score > 0.0f) { numberRusults++; } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]