sgup432 commented on issue #15097:
URL: https://github.com/apache/lucene/issues/15097#issuecomment-3208213076

   > BooleanQuery was supposed to go with the latter -- that is, its 
isCacheable method returns false if there are more than 16 clauses 
   
   Seems like I missed this, thanks for pointing it out and for the context.
   
   >So, now, I'm wondering how we end up with BooleanQuery instances averaging 
3.2MB
   
   In this case, seems like there was an OpenSearch `FunctionScoreQuery`(which 
contained ScoreFunction[]) which was taking most of that 3.2mb query size. 
Probably as a start, we should also disable caching for `FunctionScoreQuery` in 
OpenSearch if it goes beyond a certain size if possible.
   
   
   >I'm wondering if there could be a simple fix for 
BooleanQuery#isCacheable(LeafReaderContext) where we use a visitor to visit 
children, where that visitor early-terminates (by throwing an exception?) once 
it collects too many clauses? It might be worth opening a Lucene issue to 
discuss options there
   
   Makes sense. I can open an issue for that if you want though I feel we could 
have that discussion here itself for the context?
   
   Probably we can reuse(or make it better) `RamUsageEstimator.sizeOf(Query)` 
for BooleanQueries atleast? Through my experiments I saw that it kinda 
overestimates the size, but that would still be fine instead of the default 1kb.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to