Le ven. 8 janv. 2016 à 12:05, samt & sonders <kont...@samtundsonders.at> 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: https://issues.apache.org/jira/browse/LUCENE-6784. 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.