Github user tballison commented on the issue:

    https://github.com/apache/lucene-solr/pull/328
  
    Wow...long time since I've visited this code.  Now I think I recall...the 
ugliness that I don't like imposing on the CustomAnalyzer's API is that it 
holds its own ResourceLoader and applies it when the user calls, e.g. 
`withTokenizer(class/classname, params)`, 
`add(Token|Char)Filter(class/classname, params)`.  
    
    In Solr, the charfilter, tokenizer, tokenfilter factories are fully built 
with resources loaded by `FieldTypePluginLoader`'s  `loader` a 
(`SolrResourceLoader`) in `readAnalyzer(Node node)` one by one...I think (???), 
and _then_ they are added to the `CustomAnalyzer`.
    
    I also see in `ManagedIndexSchema`, that there's `postReadInform()` which 
calls `informResourceLoaderAwareObjectsInChain`, which then loads the resources.
    
    So, when I break the API in CustomAnalyzer and make public, e.g. 
`addTokenFilter(TokenFilterFactory factory)`, there's an unused private 
variable `ResourceLoader loader`, which feels ugly...a user could both specify 
a resource loader in `Builder`'s initializer and then pass in fully loaded 
components that would bypass that resource loader.  This smells bad to me...
    
    Any recommendations?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to