Thanks for you suggestions.

I do need SolrCore, but I could probably live with just SolrResourceLoader,
while also creating my own FieldType (which can be ResourceLoaderAware).

Bojan


On Thu, Feb 26, 2009 at 11:48 PM, Chris Hostetter
<hossman_luc...@fucit.org>wrote:

>
> : I am writing a custom analyzer for my field type. This analyzer would
> need
> : to use SolrResourceLoader and SolrConfig, so I want to make it
> : SolrCoreAware.
>
> 1) Solr's support for using Analyzer instances is mainly just to make it
> easy for people who already have existing ANalyzer impls that they want to
> use -- if you're writing something new, i would suggest implementing the
> TokenizerFactory API.
>
> 2) Do you really need access to the SolrCore, or do you just need access
> to the SolrResourceLoader?  Because there is also the ResourceLoaderAware
> API.  If you take a look at StopFilterFactory you can see an example of
> how it's used.
>
> FWIW: The reasons Solr doesn't support SolrCoreAware Analysis related
> plugins (TokenizerFactory and TokenFilterFactory) are:
>
> a. it kept the initalization a lot simpler.  currently SOlrCore knows
> about the INdexSchema, but the IndexSchema doesnt' know anythng about the
> SolrCore.
> b. it allows for more reuse of the schema related code independent of the
> rest of Solr (there was talk at one point of promoting all of the
> IndexSchema/FieldType/Token*Factory code into a Lucene-Java contrib but
> so far no one has steped up to work out the refactoring)
>
>
> -Hoss
>
>

Reply via email to