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 Pete Smith <pe...@lovefilm.com> on 2009/09/22 16:26:19 UTC

Function query result as a filter query

Hi,

Is it possible to constrain a resultset using a filter query to only
return the top 100 documents for a particular field?

Say I have a field called 'hits' that has the total number of hits for
that item. I want to return only the documents that have the top 100
highest hits.

I want something like this:

fq=ord(hits):[* TO 100]

But that does not appear to work - I don't think I can use a function
query for the source of a query. I want it as a filter query so I can
also use it as a facet query.

Cheers,
Pete


Re: Function query result as a filter query

Posted by Yonik Seeley <yo...@lucidimagination.com>.
It's probably not exactly what you're looking for, but you can do
ranges over functions in Solr 1.4
http://www.lucidimagination.com/blog/2009/07/06/ranges-over-functions-in-solr-14/

-Yonik
http://www.lucidimagination.com



On Tue, Sep 22, 2009 at 10:26 AM, Pete Smith <pe...@lovefilm.com> wrote:
> Hi,
>
> Is it possible to constrain a resultset using a filter query to only
> return the top 100 documents for a particular field?
>
> Say I have a field called 'hits' that has the total number of hits for
> that item. I want to return only the documents that have the top 100
> highest hits.
>
> I want something like this:
>
> fq=ord(hits):[* TO 100]
>
> But that does not appear to work - I don't think I can use a function
> query for the source of a query. I want it as a filter query so I can
> also use it as a facet query.
>
> Cheers,
> Pete
>
>