phuckx

solr - schema example

Apr 23rd, 2017
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 4.05 KB | None | 0 0
  1. <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  2.       <analyzer type="index">
  3.         <tokenizer class="solr.StandardTokenizerFactory"/>
  4.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  5.         <!-- in this example, we will only use synonyms at query time
  6.         <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  7.         -->
  8.         <filter class="solr.LowerCaseFilterFactory"/>
  9.       </analyzer>
  10.       <analyzer type="query">
  11.         <tokenizer class="solr.StandardTokenizerFactory"/>
  12.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  13.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  14.         <filter class="solr.LowerCaseFilterFactory"/>
  15.       </analyzer>
  16.     </fieldType>
  17.    
  18.    
  19.     <fieldType name="text_html" class="solr.TextField" positionIncrementGap="100">
  20.       <analyzer type="index">
  21.         <charFilter class="solr.HTMLStripCharFilterFactory"/>
  22.         <tokenizer class="solr.StandardTokenizerFactory"/>
  23.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  24.         <!-- in this example, we will only use synonyms at query time
  25.         <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  26.         -->
  27.         <filter class="solr.LowerCaseFilterFactory"/>
  28.       </analyzer>
  29.       <analyzer type="query">
  30.         <charFilter class="solr.HTMLStripCharFilterFactory"/>
  31.         <tokenizer class="solr.StandardTokenizerFactory"/>
  32.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  33.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  34.         <filter class="solr.LowerCaseFilterFactory"/>
  35.       </analyzer>
  36.     </fieldType>
  37.  
  38.     <!-- A text field with defaults appropriate for English: it
  39.          tokenizes with StandardTokenizer, removes English stop words
  40.          (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
  41.          finally applies Porter's stemming.  The query time analyzer
  42.          also applies synonyms from synonyms.txt. -->
  43.     <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
  44.       <analyzer type="index">
  45.         <tokenizer class="solr.StandardTokenizerFactory"/>
  46.         <!-- in this example, we will only use synonyms at query time
  47.         <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  48.         -->
  49.         <!-- Case insensitive stop word removal.
  50.         -->
  51.         <filter class="solr.StopFilterFactory"
  52.                ignoreCase="true"
  53.                words="lang/stopwords_en.txt"
  54.                />
  55.         <filter class="solr.LowerCaseFilterFactory"/>
  56.     <filter class="solr.EnglishPossessiveFilterFactory"/>
  57.         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  58.     <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  59.         <filter class="solr.EnglishMinimalStemFilterFactory"/>
  60.     -->
  61.         <filter class="solr.PorterStemFilterFactory"/>
  62.       </analyzer>
  63.       <analyzer type="query">
  64.         <tokenizer class="solr.StandardTokenizerFactory"/>
  65.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  66.         <filter class="solr.StopFilterFactory"
  67.                ignoreCase="true"
  68.                words="lang/stopwords_en.txt"
  69.                />
  70.         <filter class="solr.LowerCaseFilterFactory"/>
  71.     <filter class="solr.EnglishPossessiveFilterFactory"/>
  72.         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  73.     <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  74.         <filter class="solr.EnglishMinimalStemFilterFactory"/>
  75.     -->
  76.         <filter class="solr.PorterStemFilterFactory"/>
  77.       </analyzer>
  78.     </fieldType>
Add Comment
Please, Sign In to add comment