Nalini,

Assuming that you're using Solr, the hook into the collate functionality is in 
SpellCheckComponent#addCollationsToResponse .  To do what you want, you would 
have to modify the call to SpellCheckCollator to issue test queries against the 
individual words instead of the collations.

See 
http://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java

Of course if you're using Lucene directly and not Solr, then you would want to 
build a series of queries that each query one word with the filters applied.  
DirectSpellChecker#suggestSimilar returns an array of SuggestWord instances 
that contain the individual words you would want to try.  To optimize this, you 
can use the same approach as in SOLR-3240, implementing a Collector that only 
looks for 1 document then quits.

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


-----Original Message-----
From: Nalini Kartha [mailto:nalinikar...@gmail.com] 
Sent: Thursday, December 27, 2012 2:31 PM
To: solr-user@lucene.apache.org
Subject: Re: Converting fq params to Filter object

Hi James,

Yup, that was what I tried to do initially but it seems like calling
through to those Solr methods from DirectSpellChecker was not a good idea -
am I wrong? And like you mentioned, this seemed like it wasn't low-level
enough.

Eric: Unfortunately the collate functionality does not work for our use
case since the queries we're correcting are default OR. Here's the original
thread about this -

http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201212.mbox/%3ccamqozyftgiwyrbvwsdf0hfz1sznkq9gnbjfdb_obnelsmvr...@mail.gmail.com%3E

Thanks,
Nalini

On Thu, Dec 27, 2012 at 2:46 PM, Dyer, James
<james.d...@ingramcontent.com>wrote:

> https://issues.apache.org/jira/browse/SOLR-3240

Reply via email to