user3174311
user3174311

Reputation: 1991

Which is the order SOLR filters are executed?

Is there a specific order these filter are executed? I tried to move the filters around and I haven't got clear results.

        <analyzer type="query">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.ASCIIFoldingFilterFactory"/>
            <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
            <filter class="solr.WordDelimiterGraphFilterFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.PorterStemFilterFactory"/>
        </analyzer>

Upvotes: 1

Views: 231

Answers (1)

MatsLindh
MatsLindh

Reputation: 52802

They're executed in the order you've defined them.

Moving them around might not change anything, as it'll depend on how the tokens are transformed by that specific filter. The tokenizer is the only exception as that will be executed before any regular filters, while any charFilters will be executed before the tokenizer (i.e. charFilter -> Tokenizer -> filters).

You can use the Analysis section under the Solr admin page to see how each filter processes tokens in sequence and what the input and result is for each step of the chain.

You'll also have to reload your configuration (usually done by reloading the core or collection) after changing it.

Upvotes: 1

Related Questions