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 Thu, 27 Dec 2012 19:09:04 GMT
Hi Eric,

Sorry, I think I wasn't very clear in explaining what we need to do.

We don't really need to do any complicated overriding, just want to change
the DirectSpellChecker to issue a query for every correction it finds *with
fq params from the original query taken into account* so that we can check
if the correction would actually result in some hits.

I was thinking of implementing this using the IndexSearcher.search(Query
query, Filter filter, int n) method where 'query' is a regular TermQuery
(the term is the correction) and 'filter' would represent the fq params.
What I'm not sure about is how to convert the fq params from Solr into a
Filter object and whether this is something we need to build ourselves or
if there's an existing API for this.

Also, I'm new to this code so not sure if I'm approaching this the wrong
way. Any advice/pointers are much appreciated.

Thanks,
Nalini



On Thu, Dec 27, 2012 at 12:53 PM, Erik Hatcher <erik.hatcher@gmail.com>wrote:

> I think the answer is yes, that there's a better way to doing all of this.
>  But I'm not yet sure what this all entails in your situation.  What are
> you overriding with the Lucene searches?   I imagine Solr has the
> flexibility to handle what you're trying to do without overriding anything
> core in SolrIndexSearcher.
>
> Generally, the way to get a custom filter in place is to create a custom
> query parser and use that for your fq parameter, like fq={!myparser
> param1='some value'}possible+expression+if+needed, so maybe that helps?
>
> Tell us more about what you're doing specifically, and maybe we can guide
> you to a more elegant way to plug in any custom logic you want.
>
>         Erik
>
> On Dec 26, 2012, at 11:21 , 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 IndexSearcher.search(Query 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
>
>

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