This will sound silly, but which version of Solr are you using ? According to : https://issues.apache.org/jira/browse/SOLR-7888 This new cool feature will be included in solr 5.4 .
Cheers On 15 October 2015 at 22:53, Salman Ansari <salman.rah...@gmail.com> wrote: > Hi guys, > > I am working with Solr suggester as explained in this article. > https://cwiki.apache.org/confluence/display/solr/Suggester > > The suggester is working fine but I want to filter the results based on a > filed (which is type). I have tried to follow what was written at the end > of the article (about Context Filtering) but still could not get the filter > working. > > My Solr configuration for suggestion is > > <searchComponent name="suggest" class="solr.SuggestComponent"> > <lst name="suggester"> > <str name="name">mySuggester</str> > <str name="lookupImpl">AnalyzingInfixLookupFactory</str> > <str name="dictionaryImpl">DocumentDictionaryFactory</str> > <str name="field">entity_autocomplete</str> > <str name="contextField">type</str> > <str name="suggestAnalyzerFieldType">text_auto</str> > <str name="buildOnStartup">false</str> > </lst> > </searchComponent> > > I have two entries for "Bill Gates" one with type=people and the other with > type=organization. > > I have tried the following query but still get both records for suggestion > (The right thing is to get one since I only have one Bill Gates as a type > of organization) > > Here is my query > > http:// > > [MySolr]/[MyCollection]/suggest?suggest=true&suggest.build=true&suggest.dictionary=mySuggester&suggest.q=Bill&suggest.cfq=people > > Any comments why this is not filtering? > > Regards, > Salman > -- -------------------------- 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