Was digging around some more and I noticed the use of ProcessedFilter in
SolrIndexSearcher.getDocListNC(). Could I first create a ProcessedFilter
from the fq params in the DirectSolrSpellChecker and then pass down the
Lucene Filter object from the ProcessFilter to the DirectSpellChecker for
the correction queries?

Thanks,
Nalini


On Fri, Dec 28, 2012 at 12:09 PM, Nalini Kartha <nalinikar...@gmail.com>wrote:

> Hi James,
>
> We're using Solr but reason I wanted to issue the queries from
> DirectSpellChecker was so that we don't end up returning a bunch of
> corrections from suggestSimilar() which then later get weeded out when we
> run the extra correction queries because they would return no hits taking
> fqs into account. If we were able to issue the queries at the time of
> building up the list of corrections then we know that they are all valid.
>
> Thanks for the pointer to the EarlyTerminatingCollector, that seems like
> it would improve perf a lot.
>
> I'm still not sure if there's an easy way to build the Filter object from
> the fq params though, will keep digging around. If someone could point me
> to any code that does this conversion (I'm guessing that conversion needs
> to be done at some point for regular queries when Solr calls into Lucene
> but I could be wrong) that would be much appreciated.
>
> Thanks,
> Nalini
>
>
> On Thu, Dec 27, 2012 at 4:28 PM, Dyer, James <james.d...@ingramcontent.com
> > wrote:
>
>> 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