--- On Sun, 12/12/10, Lev Alyshayev <[email protected]> wrote:
> From: Lev Alyshayev <[email protected]> > Subject: FunctionQuery > To: [email protected] > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
