Lucene and memcached

Gregory Block gblock at
Sun Dec 12 02:14:01 PST 2004

On 12 Dec 2004, at 01:01, Ryan Boyce wrote:
> I have a question regarding lucene and memcached. After switching from 
> searching via SQL (fulltext indexes) to Lucene, I have noticed a 
> considerable amount of CPU time being used by my servers. I would like 
> to implement memcached on top of Lucene to relieve some of this load 
> off my app servers. Almost 80% of queries a day are redundant and 
> aren’t being cached. Is there a way I can use memcache to cache my 
> lucene queries?

If you can build a way to create a hash representing a query, you can 
cache the full results of the query.

However:  You're probably much, much better off spending some time 
optimising the way you query in the first place.  Lucene has a complex 
relationship between search performance, searchers, and some of the 
objects which, while you *can* instantiate copies each time, having 
good performance requires that you keep around.

Assuming, of course, that you're probably doing what everyone does 
first time around:  creating index Readers and Searchers on each 
request, and not using any of the cacheable representations of those 

That's your first port of call.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1245 bytes
Desc: not available
Url :

More information about the memcached mailing list