Search code examples
solrfieldtype

How Solr stores a fieldtype with 2 or more filters that returns the same value?


I have a fieldtype in my schema like this:

<fieldType name="cleanquery" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.KeywordTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.ASCIIFoldingFilterFactory"/>
    <filter class="solr.PatternReplaceFilterFactory" pattern=" " replacement="-"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="/" replacement="-"/>
  </analyzer>
</fieldType>

When I index this value: "Grand Suite", the steps for this fieldType are these:

KT -> Grand Suite
LCF -> grand suite
ASCIIFF -> grand suite
PRF -> grand-suite
PRF -> grand-suite

As you can see, the steps 2 and 3, 4 and 5 returns the same values. How Solr stores internally these steps? It saves two times the same value or, if the value is identical, it stores just one time?


Solution

  • Solr stores the value that is output by the last filter in your analyzer chain, in this case grand-suite. What you are seeing here is the progression of how the value you have supplied is transformed by the various analyzers you have defined for the field.