How to implement correctly my custom tokenizer in Lucene/Solr?
<p>I'm using Solr 5.5.2 and Lucene 5.5.2 under the hood.</p>

<p>What I'm trying to do is to create my custom tokenizer, which divides text by slash symbol.</p>

<p>Here is the code sample:</p>

<pre><code>public class SlashSymbolTokenizer extends CharTokenizer {

public SlashSymbolTokenizer() {
}

public SlashSymbolTokenizer(AttributeFactory factory) {
    super(factory);
}

@Override
protected boolean isTokenChar(int c) {
    return c != 47 &amp;&amp; c != 92;
}
}
</code></pre>

<p>schema.xml</p>

<pre><code>&lt;fieldType name="string_with_slash_tokenizer" class="solr.TextField" sortMissingLast="true"&gt;
&lt;analyzer&gt;
    &lt;tokenizer class="tokenizer.SlashSymbolTokenizerFactory"/&gt;
    &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
  &lt;/analyzer&gt;
&lt;/fieldType&gt;
</code></pre>

<p>And after applying this tokenizer at index time for a field <code>"color":"Black/white"</code> I assume that I could match it further by querying something like <code>"color":"black white"</code>, but it doesn't work.. this field matches only by the initial value <code>"Black/white"</code></p>

<p>What is wrong with my implementation ? Do you have any ideas ?</p>

<p>Thanks a lot!</p>