You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dcode <da...@gmail.com> on 2013/07/12 16:44:56 UTC

Multiple queries or Filtering Queries in Solr


My problem is I have n fields (say around 10) in Solr that are searchable,
they all are indexed and stored. I would like to run a query first on my
whole index of say 5000 docs which will hit around an average of 500 docs.
Next I would like to query using a different set of keywords on these 500
docs and NOT on the whole index.

So the first time I send a query a score will be generated, the second time
I run a query the new score generated should be based on the 500 documents
of the previous query, or in other words Solr should consider only these 500
docs as the whole index.

To summarise this, Index of 5000 will be filtered to 500 and then 50
(5000>500>50). Its basically filtering but I would like to do this in Solr.

I have reasonable basic knowledge and still learning.

Update: If represented mathematically it would look like this:
results1=f(query1)
results2=f(query2, results1)
final_results=f(query3, results2)

I would like this to be accomplish using a program and end-user will only
see 50 results. So faceting is not an option.




--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-queries-or-Filtering-Queries-in-Solr-tp4077574.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple queries or Filtering Queries in Solr

Posted by Erick Erickson <er...@gmail.com>.
Isn't this just a filter query? (fq=)?

Something like
q=query2&fq=query1

Although I don't quite understand the 500 > 50, but you can always
tack on additional fq clauses, it's basically set intersection.

As for limiting the results a user sees, that's what thr &rows parameter is for.

So another way of looking at this is "can you form a query that expresses
the use-case and just show the top N (in this case 50)?" Does that work?

Best
Erick

On Fri, Jul 12, 2013 at 10:44 AM, dcode <da...@gmail.com> wrote:
>
>
> My problem is I have n fields (say around 10) in Solr that are searchable,
> they all are indexed and stored. I would like to run a query first on my
> whole index of say 5000 docs which will hit around an average of 500 docs.
> Next I would like to query using a different set of keywords on these 500
> docs and NOT on the whole index.
>
> So the first time I send a query a score will be generated, the second time
> I run a query the new score generated should be based on the 500 documents
> of the previous query, or in other words Solr should consider only these 500
> docs as the whole index.
>
> To summarise this, Index of 5000 will be filtered to 500 and then 50
> (5000>500>50). Its basically filtering but I would like to do this in Solr.
>
> I have reasonable basic knowledge and still learning.
>
> Update: If represented mathematically it would look like this:
> results1=f(query1)
> results2=f(query2, results1)
> final_results=f(query3, results2)
>
> I would like this to be accomplish using a program and end-user will only
> see 50 results. So faceting is not an option.
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Multiple-queries-or-Filtering-Queries-in-Solr-tp4077574.html
> Sent from the Solr - User mailing list archive at Nabble.com.