Scoring in riak-search

Ryan Zezeski rzezeski at
Mon Oct 15 12:37:28 EDT 2012


On Wed, Oct 10, 2012 at 9:44 AM, Niklas Saers <njs at> wrote:
> When I do a search, I receive a responseHeader that has a maxScore. That's
> great, but the score for the individual documents doesn't show. How do I
> get the score for the individual documents listed in my search? I want to
> use this to display to my users 1-5 stars of how well they matched.

This is a bug in the Solr-like interface to Riak Search.  It discards the
score when building the response.

> Secondly, if I add a postfix * to any of my search terms, it searches
> fine, but maxScore says 0.00000e+0. Why is this?

This is because a single prefix query, e.g. motor*, will use a range op.  A
range op doesn't affect scoring [1].  Since no non-suffix query was given
along with it there is no scoring information and it defaults to 0.

> And finally, if I add a weight after my postfix *, i.e. ^5, I get "Unable
> to parse request: {badmatch, {error, { lucene_parse, "syntax error before:
> 5.0" } } }  Why is this? As far as I can understand from the docs, a query
> such as "title:listening*^5" should be fine?

The parser doesn't understand this query.  Even if it did it wouldn't
matter because the range op doesn't respect boosting.

For the last few months I've been working on a new search solution for Riak
that uses Solr directly [2].  That is, unlike Riak Search which pretends to
look like Solr it actually is Solr underneath.  Queries like the above,
plus many more, are supported.  I know that doesn't help your current
situation but if you want to learn more feel free to contact me on a



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list