0
votes

When Solr build the index, it gets parts of email address.

For exemple, if i have an email like this : [email protected], Solr indexes the words "foo" and "barcom".

I want to remove theses words but I don't know how to do this. I tried to modify the configuration file schema.xml adding this rule on my indexed field :

<filter class="solr.PatternReplaceFilterFactory" pattern=" (.*)@(.*) " replacement=" " replace="all"/>

However, it doesn't work.

1

1 Answers

0
votes

You can detect tokens as a e-mailaddress and blacklist them using

  <fieldType name="emails" class="solr.TextField" sortMissingLast="true" omitNorms="true">
  <analyzer>
    <tokenizer class="solr.UAX29URLEmailTokenizerFactory"/>
    <filter class="solr.TypeTokenFilterFactory" types="email_type.txt" useWhitelist="true"/>
  </analyzer>
</fieldType>