lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-3786) Create SearcherTaxoManager
Date Tue, 09 Apr 2013 20:36:15 GMT

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

Michael McCandless commented on LUCENE-3786:
--------------------------------------------

{quote}
bq. that decRef could have closed the reader

Hmm ... if we assume that this TR/IR pair is managed only by that manager, then an IOE thrown
from decRef could only be caused by closing the reader, right?
So if you successfully IR.decRef() but fail to TR.decRef(), it means that IR is closed already
right? Therefore there's no point to even tryIncRef?
{quote}

You're right ... so I just left the two decRefs in the patch ...
                
> Create SearcherTaxoManager
> --------------------------
>
>                 Key: LUCENE-3786
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3786
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: modules/facet
>            Reporter: Shai Erera
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 5.0, 4.3
>
>         Attachments: LUCENE-3786-3x-nocommit.patch, LUCENE-3786.patch, LUCENE-3786.patch
>
>
> If an application wants to use an IndexSearcher and TaxonomyReader in a SearcherManager-like
fashion, it cannot use a separate SearcherManager, and say a TaxonomyReaderManager, because
the IndexSearcher and TaxoReader instances need to be in sync. That is, the IS-TR pair must
match, or otherwise the category ordinals that are encoded in the search index might not match
the ones in the taxonomy index.
> This can happen if someone reopens the IndexSearcher's IndexReader, but does not refresh
the TaxonomyReader, and the category ordinals that exist in the reopened IndexReader are not
yet visible to the TaxonomyReader instance.
> I'd like to create a SearcherTaxoManager (which is a ReferenceManager) which manages
an IndexSearcher and TaxonomyReader pair. Then an application will call:
> {code}
> SearcherTaxoPair pair = manager.acquire();
> try {
>   IndexSearcher searcher = pair.searcher;
>   TaxonomyReader taxoReader = pair.taxoReader;
>   // do something with them
> } finally {
>   manager.release(pair);
>   pair = null;
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message