Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 74910 invoked from network); 30 Mar 2004 19:28:08 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 30 Mar 2004 19:28:08 -0000 Received: (qmail 42363 invoked by uid 500); 30 Mar 2004 19:27:53 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 42337 invoked by uid 500); 30 Mar 2004 19:27:53 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 42321 invoked from network); 30 Mar 2004 19:27:53 -0000 Received: from unknown (HELO RCEXO1P.icc) (67.112.197.235) by daedalus.apache.org with SMTP; 30 Mar 2004 19:27:53 -0000 Received: by rcexo1p.icc with Internet Mail Service (5.5.2657.72) id ; Tue, 30 Mar 2004 11:28:03 -0800 Message-ID: From: Ching-Pei Hsing To: "'lucene-user@jakarta.apache.org'" Subject: The Filter got called more than one time Date: Tue, 30 Mar 2004 11:28:07 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, We implemented a Filter that performs filtering based on some internal pricing logic. While testing we discovered that this filter got called several times, not like the FAQ says, exactly one time. And the number of calls made was based on how big the result set was. I printed out the calling stack and discovered that Hits.doc(n) also calls IndexSearcher.search(Query, Filter) when there're more docs needed. I can understand the lazy retrieve for optimization, but it seems wrong to me to just call the search function again and again. At least the filter should not be invoked over and over again. Logic in our filter is a little bit heavier than usual already. We definitely want to reduce the number of calls to it. Is there any way we can work around this? Call to Searcher.search() at com.comergent.reference.appservices.productService.search.query.PricingFilte r.bits(PricingFilter.java:244) at com.comergent.api.appservices.search.query.CmgtFilter.bits(CmgtFilter.java:1 08) at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:132) at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:93) at org.apache.lucene.search.Hits.(Hits.java:80) at org.apache.lucene.search.Searcher.search(Searcher.java:71) Call to Hits.doc() at com.comergent.reference.appservices.productService.search.query.PricingFilte r.bits(PricingFilter.java:244) at com.comergent.api.appservices.search.query.CmgtFilter.bits(CmgtFilter.java:1 08) at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:132) at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:93) at org.apache.lucene.search.Hits.hitDoc(Hits.java:153) at org.apache.lucene.search.Hits.doc(Hits.java:118) Thanks Ching-pei --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org