Home | About | Sematext search-lucene.com search-hadoop.com
 Search Lucene and all its subprojects:

Switch to Threaded View
Lucene >> mail # user >> FunctionQuery

Copy link to this message
Re: FunctionQuery

--- On Sun, 12/12/10, Lev Alyshayev <[EMAIL PROTECTED]> wrote:

> From: Lev Alyshayev <[EMAIL PROTECTED]>
> Subject: FunctionQuery
> Date: Sunday, December 12, 2010, 8:42 PM
> Hello there,
> I am trying to solve a problem where I use a new
> FunctionQuery to sort the
> results by changing the score. The functionality works
> great when I actually
> find results and it sorts them exactly the way I intended.
> My problem is that when there are no results found, from
> some reason the
> function is being used on all documents, rather then on no
> documents. Same
> query without the function query brings no results, but
> when I add a
> function query it returns me all documents after putting
> them through the
> function I created.
> When I search for the following I get no results:
> http://localhost:8983/solr/select/?q=text:something&fl=score
> Same query with the function query included, gives me all
> documents in the
> index:
> http://localhost:8983/solr/select/?q=text:something+_val_
> :"eqsim(somefield,sometext)"&fl=score

When you use _val_ hook, it uses addition operator.

To use multiplication (scores are multiplied) you can use http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html