lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <>
Subject Re: Proper use of LRUQueryCache
Date Sat, 09 Jan 2016 12:22:56 GMT
Le ven. 8 janv. 2016 à 12:05, samt & sonders <> a
écrit :

> It seems like a default QueryCache is already set for an IndexReader
> acquired by the SearcherManager. Is there any information about the
> default settings?

Query caching is indeed enabled by default since 5.4:  The default cache is
tiny (32MB), you might want to make it a bit larger, especially if your
indices are large. For instance caching a single filter on an index that
contains 1B documents could require up to 120MB of RAM (worst case).

Beware to not make it too large however, memory is usually better spent on
the filesystem cache than on a query cache.

> And are there any requirements I have to meet for the cache to work
> properly beside than having a BooleanQuery with
> BooleanClause.Occur.FILTER clauses?

Everything below a ConstantScoreQuery, a FILTER and a MUST_NOT clauses is
considered a filter. Additionally, if scores are not needed (for instance
if you're not sorting on the score), then the whole query is considered a
filter and could be cached.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message