lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nalini Kartha <nalinikar...@gmail.com>
Subject Re: Converting fq params to Filter object
Date Fri, 28 Dec 2012 17:09:52 GMT
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.Dyer@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:nalinikartha@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_OBNeLsMvR0XA@mail.gmail.com%3E
>
> Thanks,
> Nalini
>
> On Thu, Dec 27, 2012 at 2:46 PM, Dyer, James
> <James.Dyer@ingramcontent.com>wrote:
>
> > https://issues.apache.org/jira/browse/SOLR-3240
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message