I'm implementing an search service with SOLR 4.10 and would like to provide search suggestions based on the already specified term. Pretty standard feature for todays search applications...
What I want is that SOLR searches case insensitive for suggestions BUT return the original case string, which seems not to be possible... search: abc return: AbCdEfG
when I use the "LowerCaseFilterFactory" the search is case insensitive but the returned suggestions are all lowercased. When I remove it the returned suggestions are original but the search is not case insensitive.... =/
I added this request handler and search component to my solrconfig.xml:
<requestHandler name="/suggest" class="org.apache.solr.handler.component.SearchHandler">
<lst name="defaults">
<str name="echoParams">none</str>
<str name="wt">json</str>
<str name="indent">false</str>
<str name="spellcheck">true</str>
<str name="spellcheck.dictionary">_all</str>
<str name="spellcheck.onlyMorePopular">false</str>
<str name="spellcheck.count">20</str>
<str name="spellcheck.collate">false</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
<searchComponent name="suggest" class="solr.SpellCheckComponent" >
<lst name="spellchecker">
<str name="name">_all</str>
<str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
<str name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookupFactory</str>
<str name="field">_all</str>
<float name="threshold">0.</float>
<str name="buildOnCommit">true</str>
</lst>
I added this to my schema.xml
<fields>
<field name="_all" type="string" indexed="true" stored="false" multiValued="true" omitNorms="true" />
</fields>
<types>
<fieldType name="string" class="solr.TextField">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.TrimFilterFactory" />
</analyzer>
</fieldType>
</types>