O'Reilly logo

Apache Solr 3 Enterprise Search Server by Eric Pugh, David Smiley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Function queries

A function query is a user-specified composition of Solr-provided functions, most of which are mathematical in nature. It is evaluated on each matching document, taking constants and references to single-valued fields as input and returning a floating-point number via its score. Because they are technically queries, albeit strange ones, they can be used in any place you see queries in Solr (search, filtering, and so on.) and since Solr 3 they can be used to sort on too.

There are quite a few ways in which you can incorporate a function query into your searches in Solr:

Note

Despite the multitude of options here, you'll most likely just use them in boosting with the dismax parser. It's good to know about other possibilities, though. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required