How to get Suggestions in Solr 5.3.0 - solr

I am trying to implement auto complete feature using Solr 5.3.0
solrconfig.xml looks like this
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">default</str>
<str name="lookupImpl">FuzzyLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">suggest_ngram</str>
<str name="weightField">price</str>
<str name="suggestAnalyzerFieldType">text_suggest_ngram</str>
<str name="buildOnStartup">true</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
managed-schema looks like this:
<fieldType name="text_suggest_ngram" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EdgeNGramFilterFactory" maxGramSize="10" minGramSize="2" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<field name="suggest_ngram" type="text_suggest_ngram" indexed="true" stored="false"/>
<field name="name" type="string" multiValued="false" indexed="true" stored="true"/>
<field name="price" type="tlong" multiValued="false" indexed="true" stored="true"/>
<copyField source="name" dest="suggest_ngram"/>
Now when I use the analyzer from the admin panel of Solr, I can see the indexed ngrams. And it successfully points out the match.
However when I use the query:
http://localhost:8983/solr/products/suggest?suggest=true&suggest.build=true&wt=json&suggest.q=Jind
I get 0 suggestions.
The response is here:
https://api.myjson.com/bins/47r3i
There exists a value "Jindal Panther" for the name key in one of the docs.
Moreover, I have found that if I create a dummy copyfield "suggest" with type as "String", with source as "name", any suggestion that works fine on "name" will not work on "suggest". Can this be any misconfiguration of copyfield to enable suggestions?
Any help would be appreciated.
Thanks in advance.
EDIT:
Got the solution. See the accepted answer and its comments below.
There is a blog that I encountered that beautifully explains Suggesters. It is definitely worth reading for a newbie to Solr Search.
https://lucidworks.com/blog/2015/03/04/solr-suggester/

The field on which you want to configure the suggester should be store=true. It need not to be indexed. The suggester configuration will build a dictionary according to the provide configuration in the suggestComponet. The name field have stored as true where as suggest_ngram is not. You need to update the schema configuration like this:
<field name="suggest_ngram" type="text_suggest_ngram" indexed="false" stored="true"/>
Also you need to provide the parameter suggest.dictionary, the dictionary you are using for suggestions. For you it is names as default.
http://localhost:8983/solr/products/suggest?suggest=true&
suggest.build=true&
wt=json&
suggest.dictionary=default&
suggest.q=Jind
OR you can provide the dictionary configuration in requestHandler of /suggest:
<str name="suggest.dictionary">default</str>

Related

How to use Solr Suggester ContextField with boolean field

I am using Solr 6.0.0
I am tring to filter out unwanted suggestions from Solr Suggester. In my Solr database I have all my products
My products all have a boolean field "ShowOnSite". Products that are ready for sale have this value set to true. Products not yet ready have it set to false.
When I try to filter the suggested results from the suggester using this boolean field, I always get 0 results, even though I have plenty of products ready to be shown.
My Products looks somewhat like this like this:
<field name="id" type="string" indexed="true" stored="true" required="true"/>
<field name="Name" type="string" indexed="true" stored="true"/>
<field name="ShowOnSite" type="boolean" indexed="true" stored="true" />
<field name="text_autocomplete" type="textSuggest" indexed="true" stored="true"/>
The textSuggest fieldType has the following configuration:
<fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
My suggester looks like this
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">20</str>
<str name="wt">json</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">default</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="highlight">true</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">text_autocomplete</str>
<str name="weightField">InStock</str>
<str name="contextField">ShowOnSite</str>
<str name="suggestAnalyzerFieldType">textSuggest</str>
<str name="buildOnStartup">true</str>
</lst>
</searchComponent>
My query looks like this:
/suggest?suggest.q={querystring}&suggest.cfq=true
Expected
I receive only the products that has "ShowOnSite" == true
Actual
I receive 0 proucts from the suggester
I have tried other configurations aswell. By using not true I get all products:
/suggest?suggest.q={querystring}&suggest.cfq=-true
I have also tried to add the field name in the cfq. This yields 0 products:
/suggest?suggest.q={querystring}&suggest.cfq=ShowOnSite:true
EDIT1
I have also tried using either 0 or 1 for false and true respectively. These do not work either
Initial guess is that this is caused by the boolean type of the field, since no analysis happens as far as I know for the values used by the cfq.
Make a secondary field as a string field and store the false or true value verbatim in that field - and use that for filtering instead.
As suggested by MatsLindh. Use a text field instead.
The easiest way is to just copy that field:
Add this to the managed-schema file of your index (in Solr):
<field name="THE_FIELD_TO_BE_USED_BY_THE_SUGGESTER" type="text_general" indexed="true" stored="true" multiValued="false"/>
<copyField source="YOUR_BOOLEAN_FIELD" dest="THE_FIELD_TO_BE_USED_BY_THE_SUGGESTER" maxChars="30000" />

Solr suggester dictionnary not building. Java heap space error?

I'm using solr 5.3.1 and sunspot 2.2.7 on a Rails API with PostgreSQL database.
I've been trying to configure an autosuggest/autocomplete feature for days but struggle to make it work. I want that looking for "foob" return the suggestion "foobar company".
My schema.xml contains this :
<copyField source="*_text" dest="textSpell" />
<copyField source="*_text" dest="autocomplete" />
<copyField source="*_s" dest="textSpell" />
this allow me to copy for the spellcheck (which works fine) and for the autocomplete from the dynamic solr field created by sunspot :
<dynamicField name="*_text" stored="false" type="text" multiValued="true" indexed="true"/>
This dynamicField contains the value I want to work with : title_text.
My fields for spellchecking and autocompletion looks like this :
<field name="textSpell" stored="false" type="textSpell" multiValued="true" indexed="true"/>
<field name="autocomplete" stored="true" type="autocomplete" multiValued="true" indexed="true"/>
My fieldType for autocomplete looks like this :
<fieldType name="autocomplete" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="25" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
Then on solrconfig.xml i have my suggester components :
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">suggest</str>
<str name="lookupImpl">FuzzyLookupFactory</str>
<str name="storeDir">suggester_fuzzy_dir</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">autocomplete</str>
<str name="suggestAnalyzerFieldType">autocomplete</str>
<str name="buildOnOptimize">true</str>
<str name="buildOnStartup">true</str>
<str name="buildOnCommit">false</str>
</lst>
</searchComponent>
<requestHandler name="/suggesthandler" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.dictionary">suggest</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
I have 10M+ entries in my base. My goal is autosuggestion on the title attribute.
This setup should index twice my title. Indeed, my index size doubled when I reindexed with those settings.
I have indeed a folder suggester_fuzzy_dir who was created in my core data folder.
However when I startup solr, or launch the request /suggesthandler?suggest.build=true, this suggester_fuzzy_dir folder doesn't grow in size, it always contains 1 byte. However the leftover SSD storage space on my disk is reducing, I wasn't able to see from where.
After 45 minutes I usually get a java heap space out of memory error.
My disk size returns to normal.
I tried launching solr with option -memory=4096m to allocate more (My computer have 8go RAM). This still doesn't work although it should be enough ? Which makes me think the problem is somewhere else.
Edit : The error returned by solr in the console is as follow :
{
"error": {
"msg": "java.lang.OutOfMemoryError: Java heap space",
"trace": "java.lang.RuntimeException: java.lang.OutOfMemoryError:
Java heap space\n\tat org.apache.solr.servlet.HttpSolrCall.sendError(HttpSolrCall.java:618)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:477)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:214)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:179)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:499)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: java.lang.OutOfMemoryError: Java heap space\n\tat org.apache.lucene.util.packed.Packed64.<init>(Packed64.java:73)\n\tat org.apache.lucene.util.packed.PackedInts.getMutable(PackedInts.java:1009)\n\tat org.apache.lucene.util.packed.PackedInts.getMutable(PackedInts.java:976)\n\tat org.apache.lucene.util.packed.GrowableWriter.<init>(GrowableWriter.java:46)\n\tat org.apache.lucene.util.packed.PagedGrowableWriter.newMutable(PagedGrowableWriter.java:58)\n\tat org.apache.lucene.util.packed.AbstractPagedMutable.fillPages(AbstractPagedMutable.java:60)\n\tat org.apache.lucene.util.packed.PagedGrowableWriter.<init>(PagedGrowableWriter.java:52)\n\tat org.apache.lucene.util.packed.PagedGrowableWriter.<init>(PagedGrowableWriter.java:45)\n\tat org.apache.lucene.util.fst.NodeHash.rehash(NodeHash.java:164)\n\tat org.apache.lucene.util.fst.NodeHash.add(NodeHash.java:133)\n\tat org.apache.lucene.util.fst.Builder.compileNode(Builder.java:215)\n\tat org.apache.lucene.util.fst.Builder.freezeTail(Builder.java:310)\n\tat org.apache.lucene.util.fst.Builder.add(Builder.java:417)\n\tat org.apache.lucene.search.suggest.analyzing.AnalyzingSuggester.build(AnalyzingSuggester.java:557)\n\tat org.apache.lucene.search.suggest.Lookup.build(Lookup.java:193)\n\tat org.apache.solr.spelling.suggest.SolrSuggester.build(SolrSuggester.java:162)\n\tat org.apache.solr.handler.component.SuggestComponent.prepare(SuggestComponent.java:179)\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:251)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2068)\n\tat org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:669)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:462)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:214)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:179)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n",
"code": 500
}
}
So I finally made it work by increasing the memory allocated to the Java Virtual Machine.
In sunspot.yml :
development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/development
memory: 6G # => This allocate 6g RAM to the JVM
It might have worked with a 4 go memory allocation, thought. I checked the build real-time and there was some memory usage peaks over 2, sometimes 3g.
My suggester_fuzzy_dir now weight 1.3 go, which is more logical.

Solr Suggester - Store Lookup build failed

I've exhausted my search efforts as to why this isn't working. I believe I'm following the documentation correctly found at https://cwiki.apache.org/confluence/display/solr/Suggester
However, every time I attempt to build the suggester, I receive the error "SolrSuggester - Store Lookup build failed." in the logs. I can see it creating the directory for the store correctly on disk, however, there is no data within the file.
I've also tried removing the line <str name="storeDir">fuzzy_dir</str>. If I do this and try building, I don't receive the error in the logs, however, I still receive no results.
Can anyone see what I may be doing wrong?
I'm using Solr 6.5.0.
Here is what I have in my schema.xml:
<field name="name" type="text_general" indexed="true" stored="true" required="true" multiValued="false" />
<field name="term" type="suggestType" indexed="true" stored="true" />
<copyField source="name" dest="term" />
<fieldType name="suggestType" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
Here is what I have in my solrconfig.xml:
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">fuzzySuggester</str>
<str name="lookupImpl">FuzzyLookupFactory</str>
<str name="storeDir">fuzzy_dir</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">term</str>
<str name="suggestAnalyzerFieldType">suggestType</str>
<str name="buildOnStartup">false</str>
<str name="buildOnCommit">false</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.dictionary">fuzzySuggester</str>
<str name="suggest.count">5</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
This is how I'm executing the build:
http://localhost:8983/solr/my_core/suggest?suggest.build=true
you might be missing this in the fuzzySuggester:
<str name="weightField">WEIGHT</str>
even if the docs say it's an optional param, I think it might be what is messing with you. If you don't have a good field that you can use, you can just declare one like this:
<field name="WEIGHT" type="tfloat" indexed="true" stored="true" multiValued="false" />
and just don't bother putting any data into it.
Try giving suggester.dictionary=fuzzySuggester in the query.
http://localhost:8983/solr/my_core/suggest?suggest.build=true&suggester.dictionary=fuzzySuggester
After endless hours of scouring the internet and attempting suggestions provided by others on this post, I've come to the conclusion something in my solrconfig.xml or schema.xml file was corrupt.
My fix was to create a completely new core and migrate the pieces I was using in solrconfig.xml and schema.xml to get it to work. Unfortunately I don't have a better answer, but this is what I had to do in order to solve the problem.

Solr 4.10 - Suggester is not working with multi-valued field

Hello everyone i am using solr 4.10 and i am not getting the result as per my expectation. i want to get auto complete suggestion using multiple fields that is discountCatName,discountSubName and vendorName. i have a created multi-valued field "suggestions" using copyfield and using that filed for searching in suggester configuration.
Note: discountSubName & discountCatName are again multi-valued field, vendorName is string.
This is a suggestion field data from one of my document:
"suggestions": [
"Budget Car Rental",
"Car Rentals",
"Business Deals",
"Auto",
"Travel",
"Car Rentals" ]
If i type for a "car" i am getting "Budget Car Rental" in my suggestion but not "Car Rentals", below are my configurations. let me know if i need to change the tokenizer and filters.Any help in this would be appreciate.
Below is my code block as per explained the scenario above.
Suggestion field,fieldType,searchComponent and request handler respectively which i am using for auto complete suggestions
<!--suggestion field -->
<field name="suggestions" type="suggestType" indexed="true" stored="true" multiValued="true"/>
<copyField source="discountCatName" dest="suggestions"/>
<copyField source="discountSubName" dest="suggestions"/>
<copyField source="vendorName" dest="suggestions"/>
<!--suggest fieldType -->
<fieldType name="suggestType" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="[^a-zA-Z0-9]" replacement=" " />
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
</fieldType>
<!--suggest searchComponent configuration -->
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">analyzing</str>
<str name="lookupImpl">BlendedInfixLookupFactory</str>
<str name="suggestAnalyzerFieldType">suggestType</str>
<str name="blenderType">linear</str>
<str name="minPrefixChars">1</str>
<str name="doHighlight">false</str>
<str name="weightField">score</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">suggestions</str>
<str name="buildOnStartup">true</str>
<str name="buildOnCommit">true</str>
</lst>
</searchComponent>
<!--suggest request handler -->
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
<str name="suggest.dictionary">analyzing</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
I just discovered by debugging Solr 4.10 source code there is a bug in DocumentDictionaryFactory lookup, it's always look in the first string incase of multi-valued field and then stop suggestion from that document hence i am not getting expected output from my above configuration.
I have a created a separate index for all the fields i want to apply search like catName0...catName10, subName0...subName10 and then created multiple suggestion dictionaries for each fields and lastly i parsed the response form all the suggestion dictionary merged them and sorted based on weight and highlight position.
Lengthy approach but no other way as this solr 4.10 was required.

solr suggester not returning any results

I've followed the solr wiki article for suggester almost to the T here: http://wiki.apache.org/solr/Suggester. I have the following xml in my solrconfig.xml:
<searchComponent class="solr.SpellCheckComponent" name="suggest">
<lst name="spellchecker">
<str name="name">suggest</str>
<str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
<str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
<str name="field">description</str>
<float name="threshold">0.05</float>
<str name="buildOnCommit">true</str>
</lst>
</searchComponent>
<requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
<lst name="defaults">
<str name="spellcheck">true</str>
<str name="spellcheck.dictionary">suggest</str>
<str name="spellcheck.onlyMorePopular">true</str>
<str name="spellcheck.count">5</str>
<str name="spellcheck.collate">true</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
However, when I run the following query (or something similar):
../suggest/?q=barbequ
I only get the following result xml back:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">78</int>
</lst>
<lst name="spellcheck">
<lst name="suggestions"/>
</lst>
</response>
As you can see, this isn't very helpful. Any suggestions to help resolve this?
A couple of things I can think of that might cause this problem:
The source field ("description") is incorrect - ensure that this is indeed the field that seeds terms for your spell checker. It could even be that the field is a different case (eg. "Description" instead of "description").
The source field in your schema.xml is not set up correctly or is being processed by filters that cause the source dictionary to be invalid. I use a separate field to seed the dictionary, and use <copyfield /> to copy relevant other fields to that.
The term "barbeque" doesn't appear in at least 5% of records (you've indicated this requirement by including <float name="threshold">0.05</float>) and therefore is not included in the lookup dictionary
In SpellCheckComponent the <str name="spellcheck.onlyMorePopular">true</str> setting means that only terms that would produce more results are returned as suggestions. According to the Suggester documentation this has a different function (sorting suggestions by weight) but it might be worth switching this to false to see if it is causing the issue.
Relevant parts of my schema.xml:
<schema>
<types>
<!-- Field type specifically for spell checking -->
<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory" />
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.StandardFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" />
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.StandardFilterFactory" />
</analyzer>
</fieldType>
</types>
<fields>
<field name="spell" type="textSpell" indexed="true" stored="false" multiValued="true" />
</fields>
<!-- Copy fields which are used to seed the spell checker -->
<copyField source="name" dest="spell" />
<copyField source="description" dest="spell" />
<schema>
Could the problem be that you're querying /suggest instead of /spell
../suggest/?q=barbequ
In my setup this the string I pass in:
/solr/spell?q=barbequ&spellcheck=true&spellcheck.collate=true
And the first time you do a spellcheck you need to include
&spellcheck.build=true
I'm running on solr 4 btw. So, perhaps /suggest is an entirely different endpoint that does something else. If so, apologize.
Please check, if the term-parameter are set in the schema.xml, like:
<field name="TEXT" type="text_en" indexed="true" stored="true" multiValued="true"
termVectors="true"
termPositions="true"
termOffsets="true"/>
...restart solr and reindex again

Resources