The SpellCheckComponent in v1.4 does not use "fq".  All it does is take the 
keywords out of the "q" (or spellcheck.q) parameter and check them against the 
entire dictionary.  If any keyword is not in the dictionary, it gives you a 
list of alternatives.  The collate function then takes the query and 
substitutes the top alternative for each keyword with suggestions.  There is no 
filtering.  It doesn't even assure you the suggestions or the collation will be 
any better than the original query.  If you were using "fq" to filter out 
secret information, spell checking might reveal the secrets to your user anyway.

In 3.x, there is an additional feature that will check the collation against 
your index, including the "fq" parameters you sent.  This will assure you that 
the Collation is going to return some hits if you re-query for it.  This is 
probably closer to what you want.  This does not affect the individual word 
suggestions, however, as it only works for the collation query.

See http://wiki.apache.org/solr/SpellCheckComponent#spellcheck.collate for more 
information.

This added 3.x functionality is also available in 1.4.1 as a patch.  See 
https://issues.apache.org/jira/browse/SOLR-2010

James Dyer
E-Commerce Systems
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: taimurAQ [mailto:taimur_qure...@hotmail.com] 
Sent: Thursday, December 30, 2010 12:20 AM
To: solr-user@lucene.apache.org
Subject: Issue using filter query with spellCheck component


Hi,

I am trying to use a filter query along with the spellcheck component but
the resultant rows are completely ignoring the filter query parameter.

I am using solrJ API to communicate with solr1.4. Here is a code snippet of
how i am passing the query parameters:

        //start code snippet
        paramsForSpellCheck.set("q", "*:*");
        paramsForSpellCheck.set("spellcheck.q", query);
        paramsForSpellCheck.set("rows", "0");
        paramsForSpellCheck.set("indent", "on");
        paramsForSpellCheck.set("spellcheck", "on");

        paramsForSpellCheck.set("spellcheck.build", "true");
        paramsForSpellCheck.set("spellcheck.extendedResults", "true");
        paramsForSpellCheck.set("spellcheck.dictionary", "a_spell");
        paramsForSpellCheck.set("spellcheck.collate", "true");
        paramsForSpellCheck.set("spellcheck.count", "3");
        paramsForSpellCheck.set("spellcheck.onlyMorePopular", "false");
        paramsForSpellCheck.set("spellcheck.reload", "true");
        paramsForSpellCheck.set("qt", "standard");
        paramsForSpellCheck.set("fq", "catalog_id:" + catalogs);

        //end code snippet

The issue that i am facing now is that the "fq" query parameter is not
having any affect on the spellcheck query. Are there any known issues while
using filter query with the spellcheck component? If not, what am i doing
wrong?

Thanks in advance.

Regards,
Taimur


-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/Issue-using-filter-query-with-spellCheck-component-tp2166322p2166322.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to