« Return to Thread: Re: svn commit: r411882 - in /incubator/solr/trunk: CHANGES.txt src/java/org/apache/solr/analysis/KeywordTokenizerFactory.java src/test/org/apache/solr/BasicFunctionalityTest.java src/test/test-files/solr/conf/schema.xml

Re: svn commit: r411882 - in /incubator/solr/trunk: CHANGES.txt src/java/org/apache/solr/analysis/KeywordTokenizerFactory.java src/test/org/apache/solr/BasicFunctionalityTest.java src/test/test-files/

by hossman_lucene :: Rate this Message:

Reply to Author | View in Thread


: A factory is certainly necessary sometimes.  You don't want to incur
: setup time for creating a SynonymMap or a StopSet for every instance
: you create.

Sure -- i'm not saying we should eliminate the Factoires completely, just
that i wish it wasn't neccessary to write a factory for every
simple Filter/Tokenizer.

: Perhaps we could look at the class type, and if it's a lucene
: Tokenizer or TokenFilter, try instantiating it directly with
: newInstance().

I was thinking of a "ReflectionFilterFactory" and a
"ReflectionTokenizerFactory" that take in the class name as an argument --
but if we want to make it automatic that's cool too ... my only concern is
that *if* the reflection performance is noticable, we'd want to make it
explicit to people that they are using it .. so they don't use...

        <tokenizer class="solr.StandardTokenizer"/>
..instead of...
        <tokenizer class="solr.StandardTokenizerFactory"/>
...just becuase they don't understand the difference, and then complain
that Solr is really slow.

: At schema creation time, we should probably check if the specified
: Tokenizer or TokenFilter has a default constructor.  If it doesn't we
: should throw an error right then, not waiting for a confusing runtime
: exception.

Why would a default constructor matter? isn't what really matters for all
of the Tokenizers and TokenFilters the one arg constructor?



-Hoss

 « Return to Thread: Re: svn commit: r411882 - in /incubator/solr/trunk: CHANGES.txt src/java/org/apache/solr/analysis/KeywordTokenizerFactory.java src/test/org/apache/solr/BasicFunctionalityTest.java src/test/test-files/solr/conf/schema.xml