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

Shai Erera commented on LUCENE-3573:
------------------------------------

+1. I think that we should nuke refresh() and adopt the IR approach, even 
though I don't like the 'maybe' and 'if', might as well make the API 
consistent. So instead of refresh() we'll have a static TR.openIfChanged that 
either returns null (no changes, or the taxonomy wasn't recreated) or a new 
instance in case it was recreated.

Note that unlike IndexReader, if the taxonomy index wasn't recreated, 
openIfChanged will modify the internal state of TR. That's ok since the 
taxonomy index was built for it: existing TR instances (that weren't refreshed) 
won't be affected as they won't know about the new categories (and taxonomy 
index doesn't support deletes) and the caller can use the same TR instance in 
that case.

Whatever we end up doing, we should remove refresh(). Even though we're not 
committed to back-compat yet (it's all experimental), I think it is dangerous 
if we'll simply modify refresh() behavior, because users may not be aware of 
the change. So a new method is a must.

Besides that, the test looks good. Was there any reason to add it to 
TestTaxonomyCombined?
                
> TaxonomyReader.refresh() is broken, replace its logic with reopen(), 
> following IR.reopen pattern
> ------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3573
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3573
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: modules/facet
>            Reporter: Doron Cohen
>            Assignee: Doron Cohen
>            Priority: Minor
>         Attachments: LUCENE-3573.patch
>
>
> When recreating the taxonomy index, TR's assumption that categories are only 
> added does not hold anymore.
> As result, calling TR.refresh() will be incorrect at best, but usually throw 
> an AIOOBE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to