Re: Caching FuzzyQuery

2008-09-06 Thread Timo Nentwig
On Tue, 11 Dec 2007, Timo Nentwig wrote: Date: Tue, 11 Dec 2007 13:27:59 +0100 From: Timo Nentwig <[EMAIL PROTECTED]> Reply-To: java-dev@lucene.apache.org To: java-dev@lucene.apache.org Subject: Caching FuzzyQuery Hi! Actually FuzzyQuery.rewrite() is pretty expensive so why not introduce a c

Re: Caching FuzzyQuery

2007-12-16 Thread Chris Hostetter
: I'm against caching in general because you always run into some hard to : understand and examine problem but this seems to be one of the rare cases : where caching makes sense. For you maybe, but i've actually seen very few instances in practice where people who are speed concious use FuzzyQ

Re: Caching FuzzyQuery

2007-12-16 Thread Chris Hostetter
: > Hoss means calling rewrite on the *result* of a rewrite. : : Uh? That's what I mean (propose), too... But currently nothing's cached at : all. : : Cache the result (BooleanQuery) of rewrite() in a WeakHashMap with key = : IndexReader and value = LRU. yes .. you can do that. you don't nee

Re: Caching FuzzyQuery

2007-12-15 Thread Timo Nentwig
On Saturday 15 December 2007 20:48:38 Yonik Seeley wrote: > On Dec 15, 2007 2:23 PM, Timo Nentwig <[EMAIL PROTECTED]> wrote: > > On Saturday 15 December 2007 00:17:10 Chris Hostetter wrote: > > > : Actually FuzzyQuery.rewrite() is pretty expensive so why not > > > : introduce a caching decorator? A

Re: Caching FuzzyQuery

2007-12-15 Thread Yonik Seeley
On Dec 15, 2007 2:23 PM, Timo Nentwig <[EMAIL PROTECTED]> wrote: > On Saturday 15 December 2007 00:17:10 Chris Hostetter wrote: > > : Actually FuzzyQuery.rewrite() is pretty expensive so why not introduce a > > : caching decorator? A WeakHashMap with key==IndexReader and value==LRU of > > : Boolean

Re: Caching FuzzyQuery

2007-12-15 Thread Timo Nentwig
On Saturday 15 December 2007 00:17:10 Chris Hostetter wrote: > : Actually FuzzyQuery.rewrite() is pretty expensive so why not introduce a > : caching decorator? A WeakHashMap with key==IndexReader and value==LRU of > : BooleanQueries. > > Applications are certainly welcome to do this (there is noth

Re: Caching FuzzyQuery

2007-12-14 Thread Chris Hostetter
: Actually FuzzyQuery.rewrite() is pretty expensive so why not introduce a : caching decorator? A WeakHashMap with key==IndexReader and value==LRU of : BooleanQueries. Applications are certainly welcome to do this (there is nothing to stop you from calling rewrite before passing the query to y