0
votes

In the solr community it is suggested that the best approach to do case insensitive term completion (while retaining original case in facet) on filter/facet values is to index the content in the form "lowercasevalue|OriginalCaseValue" such that the prefixing can match on the first part while the displayed value can be the OriginalCase value.

I would like to attain this on any field by utilizing a fieldType that would construct the value via solr.PatternRepaceFilters. how would I write a pattern replace filter that would turn "MyValue" into "myvalue|MyValue" for a field being indexed as myfield:MyValue. But term completed/faceted on myfield_tc:myvalue|MyValue?

<fieldType name="termCompleteField" class="solr.StrField">
  <analyzer type="index">
    <tokenizer class="solr.KeywordTokenizerFactory"/>
    <filter class="solr.PatternReplaceFilterFactory" ????????? />
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.KeywordTokenizerFactory"/>
  </analyzer>
</fieldType>
1

1 Answers

0
votes

why don't you replace

<filter class="solr.PatternReplaceFilterFactory" ????????? />

with

<filter class="solr.LowerCaseFilterFactory"/>

and add a copyfield termCompleteField_lowercase with this new fieldtype?