lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: The Filter got called more than one time
Date Tue, 30 Mar 2004 20:05:27 GMT
Use a caching mechanism for your filter, so the bitset is not  
regenerated.  CachingWrappingFilter is your friend :)

	Erik


On Mar 30, 2004, at 2:28 PM, Ching-Pei Hsing wrote:

> 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.Pricing 
> Filte
> r.bits(PricingFilter.java:244)
> at
> com.comergent.api.appservices.search.query.CmgtFilter.bits(CmgtFilter.j 
> ava: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.<init>(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.Pricing 
> Filte
> r.bits(PricingFilter.java:244)
> at
> com.comergent.api.appservices.search.query.CmgtFilter.bits(CmgtFilter.j 
> ava: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


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


Mime
View raw message