[ 
https://issues.apache.org/jira/browse/LUCENE-6661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14617435#comment-14617435
 ] 

Adrien Grand commented on LUCENE-6661:
--------------------------------------

I agree the proposed work-around feels hacky but I suspect this is because the 
queries we are talking about are hacky too. I see queries as objects 
representing an information need, and we already have Query.equals() which 
tells us that two queries define the same information need. If two queries are 
equal then it should be legal to cache matching documents, as well as scores.

bq. The queries that we know ahead of time should never be cached would still 
take up room in the ring buffer and thus push aside other less frequent queries 
that could be great cache candidates.

I tend to see it as a feature: if you offload such queries from the ring 
buffer, then some queries might look frequently used even though they are 
rarely used in practice, so not worth caching?

bq. Both my custom query and DrillSidewaysQuery implement a custom bulkScorer() 
method and throw an UnsupportedOperationException from scorer(). They break 
when wrapped in a CachingWraperWeight. The ability to opt of of caching would 
remove the need for the hacky workaround in DrillSideways.

To me queries that can implement bulkScorer() but not scorer() are hacky given 
that scorer() is not an optional API. This also means such queries cannot be 
embedded in other queries like BooleanQuery, etc. so I'm on the fence about 
adding new APIs that would be dictated by such queries.

> Allow queries to opt out of caching
> -----------------------------------
>
>                 Key: LUCENE-6661
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6661
>             Project: Lucene - Core
>          Issue Type: Improvement
>    Affects Versions: 5.2
>            Reporter: Terry Smith
>            Priority: Minor
>         Attachments: LUCENE-6661.patch
>
>
> Some queries have out-of-band dependencies that make them incompatible with 
> caching, it'd be great if they could opt out of the new fancy query/filter 
> cache in IndexSearcher.
> This affects DrillSidewaysQuery and any user-provided custom Query 
> implementations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to