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

Robert Muir commented on LUCENE-5170:
-------------------------------------

{quote}
Make the strategy a ENUM like class (no state). The ThreadLocal should not be 
sitting on the strategy, the strategy should only implement the strategy, not 
also take care of storing the data in the ThreadLocal.
{quote}

I like this idea, i think it could simplify the thing a lot.

{quote}
I have no idea how to fix this - it looks like we need to backwards break to 
fix this!
{quote}

Personally i support that in this case: because i think we can minimize the 
breaks at the end of the day.

For example if we switch to enums, in 4.x, we could still allow 'instantiation' 
but its just useless (since the object is stateless) and deprecated. and the 
'constants' would be declared like MultiTermQuery rewrite?

                
> Add getter for reuse strategy to Analyzer, make AnalyzerWrapper's reuse 
> strategy configureable
> ----------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-5170
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5170
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/other, modules/analysis
>    Affects Versions: 4.4
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 5.0, 4.5
>
>         Attachments: LUCENE-5170.patch
>
>
> If you write an Analyzer that wraps another one (but without using 
> AnalyzerWrapper) you may need use the same reuse strategy in your wrapper. 
> This is not possible as there is no way to get the reuse startegy (private 
> field and no getter).
> An example is ES's NamedAnalyzer, see my comment: 
> [https://github.com/elasticsearch/elasticsearch/commit/b9a2fbd8741aa1b9beffb7d2922fc9b4525397e4#src/main/java/org/elasticsearch/index/analysis/NamedAnalyzer.java]
> This would add a getter, just a 3-liner.

--
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]

Reply via email to