- Where Developers Learn, Share, & Build Careers


I have just typed a custom CharTokenizer , and I want to use it in my solar server .

In Solr3, I can only increase the TokenizerFactory and return to my tax code forming the CharTokenizer , but TokenizerFactory < Solar4 does not exist in / code>

So, I came to know that I should change the TokenizerFactory with the TokenFilterFactory , but in this situation, I did not return my custom CharTokenizer , because the parameters do not match.

I also search for some documents, but it seems that nothing is really useful in it.

So, how can I work it out?

Example:

  The public class expands MyCustomTokenizer CharTokenizer {char anotherSpace = 24; Public MyCustomTokenizer (version matching edition, reader in) {super (in Milan version,); } Protected Boolean isTokenChar (come C) {return! Character.HisSpace (C) & amp; Amp; IsToken ((four)); } Private boolean isToken (char c) {if (c == Other Space || c == ',') {return false; } Back true; }} Public class MyCustomTokenizerFactory token filterfactor (public zero zero (map & lt; string, string & gt; args) {super.init (args); assureMatchVersion ();} @ Override public tokenstream making (token stream) {// sh * Returns the new MyCustomTokenizer (luceneMatchVersion, input) here;}}   

Thanks in advance.

The best way to check for implementation is to see the source code of an existing tokenizer in Lucene

eg Rann: -




Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -