Re: Question about QueryCache

2021-02-27 Thread Haoyu Zhai
Thanks Mike and Adrien for confirming the behavior! I checked again and debugged the unit case and found it is IndexSearcher.createWeight will be recursively called when BooleanQuery is creating weight ( https://github.com/apache/lucene-solr/blob/e88b3e9c204f907fdb41d6d0f40d685574acde97/lucene/core

Re: Question about QueryCache

2021-02-26 Thread Adrien Grand
It does recurse indeed! To reuse Mike's example, in that case the cache would consider caching: - A, - B, - C, - D, - (C D), - +A +B +(C D) One weakness of this cache is that it doesn't consider caching subsets of boolean queries (except single clauses). E.g. in the above example, it would n

Re: Question about QueryCache

2021-02-26 Thread Michael McCandless
Hi Haoyu, I'm pretty sure (but not certain!) that query cache is smart enough to recurse through the full query tree, and consider any of the whole queries it finds during that recursion. So e.g. a query like +A +B +(C D) would consider caching A, B, C D, or the whole original +A +B +(C D) query.

Question about QueryCache

2021-02-22 Thread Haoyu Zhai
Hi folks, I'm trying to understand how QueryCache works and one question popped out of my head was that is QueryCache caching 1. the whole query that being submitted to IndexSearcher or 2. it will recurse into the query and selectively caching some of the clauses (especially for BooleanQuery)? >Fr