Site icon i2tutorials

Solr – Filters

Solr – Filters:

In this tutorial, we will learn about the filters in Solr which another important concept. As how the tokenizers work, the same way filters take the data stream and produce the filtered data. Its main job is to create another simplified token stream.

Example:

<fieldType name="text" class="solr.TextField">

  <analyzer>

    <tokenizer class="solr.StandardTokenizerFactory"/>

    <filter class="solr.StandardFilterFactory"/>

    <filter class="solr.LowerCaseFilterFactory"/>

    <filter class="solr.EnglishPorterFilterFactory"/>

  </analyzer>

</fieldType>

In the above example, standard tokenizer will first break the text and pass it over to filter, where the standard filter removes the dots and other operations which finally facilitate the querying text as easy and case-insensitive.

If you can observe, there is something called porter filter which actually uses the porter stemming algorithm. This works as if you have the words like “run”, “running”, “runs” will be replaced with a stem word “run” and where “ruin” will not match.

Below is the list of Filters:

Below is the list of Filter Factories:

Exit mobile version