Hi Chris,

On 24/01/11 21:18, Chris Hostetter wrote:
: I notice that in the schema, it is only possible to specify a Analyzer class,
: but not a Factory class as for the other elements (Tokenizer, Fitler, etc.).
: This limits the use of this feature, as it is impossible to specify parameters
: for the Analyzer.
: I have looked at the IndexSchema implementation, and I think this requires a
: simple fix. Do I open an issue about it ?

Support for constructing Analyzers directly is very crude, and primarily
existed for making it easy for people with old indexes and analyzers to
keep working.

moving foward, Lucene/Solr eventtually won't "ship" concret Analyzers
implementations at all (at least, that's the last concensus i remember) so
enhancing support for loading Analyzers (or AnalyzerFactories) doesn't
make much sense.

Practically speaking, if you have an existing Analyzer that you want to
use in Solr, instead of writting an "AnalyzerFactory" for it, you could
just write a "TokenizerFactory" that wraps it instead -- functinally that
would let you achieve everything ana AnalyzerFactory would, except that
Solr would already handle letting the schema.xml specify the
positionIncrementGap (which you could happily ignore if you wanted)
Thanks for the trick, I haven't thought about doing that. This should work indeed.

cheers
--
Renaud Delbru

Reply via email to