Thanks Benedetti, I've change to the AnalyzingInfixLookup approach, and it is able to start searching from the middle of the field.
However, is it possible to make the suggester to show only part of the content of the field (like 2 or 3 fields after), instead of the entire content/sentence, which can be quite long? Regards, Edwin On 15 June 2015 at 17:33, Alessandro Benedetti <benedetti.ale...@gmail.com> wrote: > ehehe Edwin, I think you should read again the document I linked time ago : > > http://lucidworks.com/blog/solr-suggester/ > > The suggester you used is not meant to provide infix suggestions. > The fuzzy suggester is working on a fuzzy basis , with the *starting* terms > of a field content. > > What you are looking for is actually one of the Infix Suggesters. > For example the AnalyzingInfixLookup approach. > > When working with Suggesters is important first to make a distinction : > > 1) Returning the full content of the field ( analysisInfix or Fuzzy) > > 2) Returning token(s) ( Free Text Suggester) > > Then the second difference is : > > 1) Infix suggestions ( from the "middle" of the field content) > 2) Classic suggester ( from the beginning of the field content) > > Clarified that, will be quite simple to work with suggesters. > > Cheers > > 2015-06-15 9:28 GMT+01:00 Zheng Lin Edwin Yeo <edwinye...@gmail.com>: > > > I've indexed a rich-text documents with the following content: > > > > This is a testing rich text documents to test the uploading of files to > > Solr > > > > > > When I tried to use the suggestion, it return me the entire field in the > > content once I enter suggest?q=t. However, when I tried to search for > > q='rich', I don't get any results returned. > > > > This is my current configuration for the suggester: > > <searchComponent name="suggest" class="solr.SuggestComponent"> > > <lst name="suggester"> > > <str name="name">mySuggester</str> > > <str name="lookupImpl">FuzzyLookupFactory</str> > > <str name="dictionaryImpl">DocumentDictionaryFactory</str> > > <str name="field">Suggestion</str> > > <str name="suggestAnalyzerFieldType">suggestType</str> > > <str name="buildOnStartup">true</str> > > <str name="buildOnCommit">false</str> > > </lst> > > </searchComponent> > > > > <requestHandler name="/suggest" class="solr.SearchHandler" > startup="lazy" > > > <lst name="defaults"> > > <str name="wt">json</str> > > <str name="indent">true</str> > > > > <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> > > > > Is it possible to allow the suggester to return something even from the > > middle of the sentence, and also not to return the entire sentence if the > > sentence. Perhaps it should just suggest the next 2 or 3 fields, and to > > return more fields as the users type. > > > > For example, > > When user type 'this', it should return 'This is a testing' > > When user type 'this is a testing', it should return 'This is a testing > > rich text documents'. > > > > > > Regards, > > Edwin > > > > > > -- > -------------------------- > > Benedetti Alessandro > Visiting card : http://about.me/alessandro_benedetti > > "Tyger, tyger burning bright > In the forests of the night, > What immortal hand or eye > Could frame thy fearful symmetry?" > > William Blake - Songs of Experience -1794 England >