Browse Source

Added custom Edge N gram Type with MappingCharFilterFactory : bé bives béton AND bettrave

Bachir Soussi Chiadmi 7 years ago
parent
commit
0aff5bb483
1 changed files with 22 additions and 0 deletions
  1. 22 0
      materio_base_fr/conf/schema.xml

+ 22 - 0
materio_base_fr/conf/schema.xml

@@ -310,6 +310,28 @@
         <filter class="solr.LowerCaseFilterFactory"/>
       </analyzer>
     </fieldType>
+
+    <!-- [MATERIO] Added custom Edge N gram Type with MappingCharFilterFactory to remove accent
+          see materio_search_api_search_api_data_type_info() in materio_search_api.module
+          purpose is to get the following feature :
+          "be" give béton and bettrave
+          BUT "bé" give only béton and NOT betterave
+     -->
+    <fieldType name="edge_n2_kw_mapped_text" class="solr.TextField" omitNorms="true" positionIncrementGap="100">
+      <analyzer type="index">
+        <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
+        <tokenizer class="solr.KeywordTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+        <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="25" />
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.KeywordTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+    </fieldType>
+
+
+
     <!--  Setup simple analysis for spell checking -->
 
     <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100">