[
https://issues.apache.org/jira/browse/LUCENE-3441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109735#comment-13109735
]
Shai Erera commented on LUCENE-3441:
------------------------------------
bq. Shouldn't you also commit in the constructor
LuceneTaxonomyWriter behaves just like IndexWriter. Today (I think since 3.1),
opening an IndexWriter is just another transaction that you should commit if
you want IndexReaders to see it. So if you try:
{code}
IndexWriter w = new IndexWriter(emptyDir, new IWC());
IndexReader r = IndexReader.open(emptyDir);
{code}
you'll get an exception as well.
If you want that to work, you must insert a commit() call after line #1, and
LTW follows this logic.
bq. Also an explanation of what it's doing underneath
Refreshing LTR means reopening its internal IndexReader instance. If it has
changed, then LTR updates its parents array with the newly added categories.
Usually, assuming the taxonomy does not grow a lot (i.e., usually after some
point your taxonomy is relatively fixed, and new categories are not added often
-- much like an index lexicon), this additional update of the parents array is
quick.
> Add NRT support to LuceneTaxonomyReader
> ---------------------------------------
>
> Key: LUCENE-3441
> URL: https://issues.apache.org/jira/browse/LUCENE-3441
> Project: Lucene - Java
> Issue Type: New Feature
> Components: modules/facet
> Reporter: Shai Erera
> Priority: Minor
>
> Currently LuceneTaxonomyReader does not support NRT - i.e., on changes to
> LuceneTaxonomyWriter, you cannot have the reader updated, like
> IndexReader/Writer. In order to do that we need to do the following:
> # Add ctor to LuceneTaxonomyReader to allow you to instantiate it with
> LuceneTaxonomyWriter.
> # Add API to LuceneTaxonomyWriter to expose its internal IndexReader
> # Change LTR.refresh() to return an LTR, rather than void. This is actually
> not strictly related to that issue, but since we'll need to modify refresh()
> impl, I think it'll be good to change its API as well. Since all of facet API
> is @lucene.experimental, no backwards issues here (and the sooner we do it,
> the better).
--
This message is automatically generated by JIRA.
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]