[
https://issues.apache.org/jira/browse/LUCENE-3786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael McCandless updated LUCENE-3786:
---------------------------------------
Attachment: LUCENE-3786.patch
Thanks for all the feedback Shai, I incorporated it all except for
this one:
bq. TR.getTaxoEpoch: maybe instead of adding it to TR you can use the one on
DTW (make it public, @lucene.internal)? It's odd that it documents that this
epoch is returned only for an NRT TR, because the epoch is recorded on the taxo
index commit data, so conceptually there's no reason why it shouldn't always
return it. Yet, since this epoch is used internally, between TW and TR, I
prefer not to expose it too much. Hmmm, but then you may hit a false positive
where the returned TR is valid, yet just in between the checks the app called
replaceTaxo. But I think that's ok since it means the check will fail on the
next refresh attempt. Really, if ever DTW.epoch changes, we should fail.
I don't like that cutting over to DTW would open up the thread hazard
that we fail to catch the replace ... admittedly it'd be rare but why
open it up? The added Expert/@lucene.internal method seems minor ...
bq. When I worked on it in the past, DTR wasn't NRT and the sync was a
nightmare. Making it NRT really simplified this manager!
Thank you for doing all the hard work first (making DTR NRT) :)
> 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, 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: [email protected]
For additional commands, e-mail: [email protected]