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 "David Smiley @MITRE.org" <DS...@mitre.org> on 2009/11/23 05:06:41 UTC

"query" function query; what's it for?

It's not clear to me what purpose the "query" function query solves.  I've
read the description:
http://wiki.apache.org/solr/FunctionQuery#query  but it doesn't really
explain the point of it. I'm sure it has to do with subtleties in how
scoring is done.  Can someone please present a use-case?

~ David
-- 
View this message in context: http://old.nabble.com/%22query%22-function-query--what%27s-it-for--tp26472546p26472546.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: "query" function query; what's it for?

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Mon, Nov 23, 2009 at 9:36 AM, Smiley, David W. <ds...@mitre.org> wrote:
> Thanks Yonik. That blog post was very interesting but it only has about a sentence or two on the query() function

Ah, I had thought that you meant the "query" QParser.
The query function just allows you to use any other query type inside
a function query.
So you could add or multiply the scores of two dismax queries
together, or whatever.

As far as practical usecases... I've used it for selectively boosting
one query based on the results of another query.  I'm sure others will
find other uses for it.

-Yonik
http://www.lucidimagination.com

Re: "query" function query; what's it for?

Posted by "Smiley, David W." <ds...@mitre.org>.
Thanks Yonik. That blog post was very interesting but it only has about a sentence or two on the query() function, and it points the user to the same link I have here at the wiki for examples.  But those examples (which is really 1 example) doesn't explain the point. -- e.g. when/why would I use this?

On Nov 22, 2009, at 11:11 PM, Yonik Seeley wrote:

> On Sun, Nov 22, 2009 at 11:06 PM, David Smiley @MITRE.org
> <DS...@mitre.org> wrote:
>> It's not clear to me what purpose the "query" function query solves.  I've
>> read the description:
>> http://wiki.apache.org/solr/FunctionQuery#query  but it doesn't really
>> explain the point of it. I'm sure it has to do with subtleties in how
>> scoring is done.  Can someone please present a use-case?
> 
> See the "Pure Nested Query" section here:
> http://www.lucidimagination.com/blog/2009/03/31/nested-queries-in-solr/
> 
> -Yonik
> http://www.lucidimagination.com


Re: "query" function query; what's it for?

Posted by Yonik Seeley <ys...@gmail.com>.
On Sun, Nov 22, 2009 at 11:06 PM, David Smiley @MITRE.org
<DS...@mitre.org> wrote:
> It's not clear to me what purpose the "query" function query solves.  I've
> read the description:
> http://wiki.apache.org/solr/FunctionQuery#query  but it doesn't really
> explain the point of it. I'm sure it has to do with subtleties in how
> scoring is done.  Can someone please present a use-case?

See the "Pure Nested Query" section here:
http://www.lucidimagination.com/blog/2009/03/31/nested-queries-in-solr/

-Yonik
http://www.lucidimagination.com