lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nalini Kartha <>
Subject Re: Converting fq params to Filter object
Date Thu, 27 Dec 2012 17:12:15 GMT
Hi Lance,

Thanks for the response.

I didn't quite understand how to issue the queries from DirectSpellChecker
with the fq params applied like you were suggesting - could you point me to
the API that can be used for this?

Also, we haven't benchmarked the DirectSpellChecker against the

I considered issuing one large OR query with all corrections but that
doesn't ensure that *every* correction would return some hits with the fq
params applied, it only tells us that some correction returned hits so this
isn't restrictive enough for us. And ANDing the corrections together
becomes too restrictive since it requires that *all* corrections existed in
the same documents instead of checking that they individually exist in some
docs (which satisfy the filter queries of course).


On Wed, Dec 26, 2012 at 9:32 PM, Lance Norskog <> wrote:

> A Solr facet query does a boolean query, caches the Lucene facet data
> structure, and uses it as a Lucene filter. After that until you do a full
> commit, using the same fq=string (you must match the string exactly)
> fetches the cached data structure and uses it again as a Lucene filter.
> Have you benchmarked the DirectSpellChecker against
> IndexBasedSpellChecker? If you use the fq= filter query as the
> spellcheck.q= query it should use the cached filter.
> Also, since you are checking all words against the same filter query, can
> you just do one large OR query with all of the words?
> On 12/26/2012 03:10 PM, Nalini Kartha wrote:
>> Hi Otis,
>> Sorry, let me be more specific.
>> The end goal is for the DirectSpellChecker to make sure that the
>> corrections it is returning will return some results taking into account
>> the fq params included in the original query. This is a follow up question
>> to another question I had posted earlier -
>> http://mail-archives.apache.**org/mod_mbox/lucene-solr-user/**
>> 201212.mbox/%**3CCAMqOzYFTgiWyRbvwSdF0hFZ1SZN**
>> kQ9gnBJfDb_OBNeLsMvR0XA@mail.**<>
>> Initially, the way I was thinking of implementing this was to call one of
>> the SolrIndexSearcher.getDocSet() methods for ever correction, passing in
>> the correction as the Query and a DocSet created from the fq queries. But
>> I
>> didn't think that calling a SolrIndexSearcher method in Lucene code
>> (DirectSpellChecker) was a good idea. So I started looking at which method
>> on IndexSearcher would accomplish this. That's where I'm stuck trying to
>> figure out how to convert the fq params into a Filter object.
>> Does this approach make sense? Also I realize that this implementation is
>> probably non-performant but wanted to give it a try and measure how it
>> does. Any advice about what the perf overhead from issuing such queries
>> for
>> say 50 corrections would be? Note that the filter from the fq params is
>> the
>> same for every query - would that be cached and help speed things up?
>> Thanks,
>> Nalini
>> On Wed, Dec 26, 2012 at 3:34 PM, Otis Gospodnetic <
>>> wrote:
>>  Hi,
>>> The fq *is* for filtering.
>>> What is your end goal, what are you trying to achieve?
>>> Otis
>>> Solr & ElasticSearch Support
>>> On Dec 26, 2012 11:22 AM, "Nalini Kartha" <>
>>> wrote:
>>>  Hi,
>>>> I'm trying to figure out how to convert the fq params that are being
>>> passed
>>>> to Solr into something that can be used to filter the results of a query
>>>> that's being issued against the Lucene IndexSearcher (I'm modifying some
>>>> Lucene code to issue the query so calling through to one of the
>>>> SolrIndexSearcher methods would be ugly).
>>>> Looks like one of the query, Filter filter,
>>> ...)
>>>>   methods would do what I want but I'm wondering if there's any easy way
>>> of
>>>> converting the fq params into a Filter? Or is there a better way of
>>>> doing
>>>> all of this?
>>>> Thanks,
>>>> Nalini

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