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

Michael McCandless commented on LUCENE-2468:
--------------------------------------------

bq. Yes, but, this means that ConstantScoreQuery should basically not be cached 
when using NRT (even with using IndexReader as key...), because of the 
excessive readers created. With the one that is deletion aware, you can cache 
it based on the cache key.

OK, now (finally) I understand the problem!

You want to be able to cache the original filter and reuse it even when 
deletions have changed, but then dynamically apply the deletions so they are 
properly enforced (rather than discarding the cache entry).

So... why not do this in CachingWrapper/SpanFilter, but, instead of discarding 
the cache entry when deletions must be enforced, we dynamically apply the 
deletions?  (I think we could use FilteredDocIdSet).

Really... we need a more generic solution here (but, it's a much bigger 
change), where somehow in creating the scorer per-segment we dynamically 
determine who/where the deletions are enforced.  A Filter need not care about 
deletions if it's AND'd w/ a query that already enforces the deletions.

> reopen on NRT reader should share readers w/ unchanged segments
> ---------------------------------------------------------------
>
>                 Key: LUCENE-2468
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2468
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Yonik Seeley
>            Assignee: Michael McCandless
>         Attachments: CacheTest.java, DeletionAwareConstantScoreQuery.java, 
> LUCENE-2468.patch, LUCENE-2468.patch
>
>
> A repoen on an NRT reader doesn't seem to share readers for those segments 
> that are unchanged.
> http://search.lucidimagination.com/search/document/9f0335d480d2e637/nrt_and_caching_based_on_indexreader

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to