Removal accent with apache solr

apache, schema, search, solr

Solution

I see from your schema that you are using the `ASCIIFoldingFilterFactory` already on your `text` fieldType that is assigned to the `default` field. However, it is only being applied to the indexing of that field. I would suggest that you also apply it to the querying of your field as well, to ensure that your query terms are being folded to match the items in the index. Typically, in a case like this when you add a filter factory to the indexing you would also add it to the querying so that query terms and index terms are all being converted/compared appropriately.

So I would modify your schema to the following:

<fieldType name="text" class="solr.TextField" omitNorms="false">
  <analyzer type="index">
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/>
    <filter class="solr.LowerCaseFilterFactory" />
    <filter class="solr.ASCIIFoldingFilterFactory" words="mapping-FoldToASCII.txt"/>
    <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/>
    <filter class="solr.LowerCaseFilterFactory" />
    <filter class="solr.ASCIIFoldingFilterFactory" words="mapping-FoldToASCII.txt"/>
    <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
  </analyzer>
</fieldType>

Problem

I'm trying to make a search with apache solr using this scheme http://pastie.org/5114389 but when I type "josé" the file is found but when I write "jose" I do not get the result. Efetuei searching the internet for an answer and had to use the class but when I insert makes no difference.

Original source