Hi Steven, I can think of one case. If we have an index of database table or column names, e.g., words like 'THIS_IS_A_TABLE_NAME', we may want to split the name at the underscores when indexing (as well as keep the original), since the individual parts might be significant and meaningful. When querying, though, if the searcher types in THIS_IS_A_TABLE_NAME then they are likely looking for the whole string, so we wouldn't want to split it apart.
There also seems to be a debate on whether the SYNONYM filter should be included on indexing, on querying, or on both. Google "solr synonyms index vs query" Mike -----Original Message----- From: Steven White <swhite4...@gmail.com> Sent: September 10, 2020 8:19 AM To: solr-user@lucene.apache.org Subject: Why use a different analyzer for "index" and "query"? [EXTERNAL] This email came from an external source. Only open attachments or links that you are expecting from a known sender. Hi everyone, In Solr's schema, I have come across field types that use a different logic for "index" than for "query". To be clear, I"m talking about this block: <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <!-- what you see in this block doesn't have to be the same as what you see inside "query" block --> </analyzer> <analyzer type="query"> <!-- what you see in this block doesn't have to be the same as what you see inside "index" block --> </analyzer> </fieldType> Why would one want to not use the same logic for both and simply use: <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100"> <analyzer> <!-- same logic to be used by for "index" and "query" --> </analyzer> </fieldType> What are real word use cases to use a different analyzer for index and query? Thanks, Steve