A friend and I are trying to develop some software using Solr in the
background, and with that comes alot of changes. We're used to older
versions (4.3 and below). We especially have problems with the
autosuggest feature.

This is the field definition (schema.xml) for our autosuggest field:

<field name="autosuggest" type="autosuggest" indexed="true"
stored="true" required="false" multiValued="true" />
...
<copyField source="name" dest="autosuggest" />
...
<fieldType name="autosuggest" class="solr.TextField"
positionIncrementGap="100">
 <analyzer type="index">
 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
 <filter class="solr.WordDelimiterFilterFactory" splitOnCaseChange="0"
splitOnNumerics="1" generateWordParts="1" generateNumberParts="1"
catenateWords="1" catenateNumbers="0" catenateAll="0"
preserveOriginal="0"/>
 <filter class="solr.LowerCaseFilterFactory"/>
 <filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true" enablePositionIncrements="true" format="snowball"/>
 <filter class="solr.DictionaryCompoundWordTokenFilterFactory"
dictionary="dictionary.txt" minWordSize="5" minSubwordSize="3"
maxSubwordSize="30" onlyLongestMatch="false"/>
 <filter class="solr.GermanNormalizationFilterFactory"/>
 <filter class="solr.SnowballPorterFilterFactory" language="German2"
protected="protwords.txt"/>
 <filter class="solr.EdgeNGramFilterFactory" minGramSize="2"
maxGramSize="30"/>
 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
 </analyzer>
 <analyzer type="query">
 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
 <filter class="solr.WordDelimiterFilterFactory" splitOnCaseChange="0"
splitOnNumerics="1" generateWordParts="1" generateNumberParts="1"
catenateWords="1" catenateNumbers="0" catenateAll="0"
preserveOriginal="0"/>
 <filter class="solr.LowerCaseFilterFactory"/>
 <filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true" enablePositionIncrements="true" format="snowball"/>
 <filter class="solr.GermanNormalizationFilterFactory"/>
 <filter class="solr.SnowballPorterFilterFactory" language="German2"
protected="protwords.txt"/>
 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
 </analyzer>
</fieldType>

Afterwards, we defined an autosuggest component to use this field, like
this (solrconfig.xml):

<searchComponent name="suggest" class="solr.SuggestComponent">
 <lst name="suggester">
 <str name="name">mySuggester</str>
 <str name="lookupImpl">FuzzyLookupFactory</str>
 <str name="storeDir">suggester_fuzzy_dir</str>
 <str name="dictionaryImpl">DocumentDictionaryFactory</str>
 <str name="field">suggest</str>
 <str name="suggestAnalyzerFieldType">"autosuggest"</str>
 <str name="buildOnStartup">false</str>
 <str name="buildOnCommit">false</str>
 </lst>
</searchComponent>

And add a requesthandler to test out the functionality:

<requestHandler name="/suggesthandler" class="solr.SearchHandler"
startup="lazy" >
 <lst name="defaults">
 <str name="suggest">true</str>
 <str name="suggest.count">10</str>
 <str name="suggest.dictionary">mySuggester</str>
 </lst>
 <arr name="components">
 <str>suggest</str>
 </arr>
</requestHandler>

However, trying to start the core that has this configuration, a long
exception occurs, telling us this:

Error in configuration: "autosuggest" is not defined in the schema

Now, that seems to be wrong. Any idea how to fix that? 

Reply via email to