You can have separate index and query time analysis chains, there are many examples in the stock Solr schemas.
Best, Erick > On Aug 27, 2019, at 8:48 AM, Bjarke Buur Mortensen <morten...@eluence.com> > wrote: > > We have a solr file of type "string". > It turns out that we need to do synonym expansion on query time in order to > account for some changes over time in the values stored in that field. > > So we have tried introducing a custom fieldType that applies the synonym > filter at query time only (see bottom of mail), but that requires us to > change the field. But now, when we index new documents, Solr complains: > 400 Bad Request > Error: 'Exception writing document id someid to the index; possible > analysis error: cannot change field "auth_country_code" from index > options=DOCS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS', > > Since we are only making query time changes, I would really like to not > have to reindex our entire collection. Is that possible somehow? > > Thanks, > Bjarke > > > <fieldType name="country_codes" class="solr.TextField" > sortMissingLast="true" positionIncrementGap="100"> > <analyzer> > <tokenizer class="solr.KeywordTokenizerFactory"/> <!-- no > splitting of input --> > </analyzer> > <analyzer type="query"> > <tokenizer class="solr.KeywordTokenizerFactory"/> > <filter class="solr.SynonymGraphFilterFactory" > synonyms="country-synonyms.txt" ignoreCase="false" expand="true"/> > </analyzer> > </fieldType>