tow/sunburnt — pull request #65 by davidjb (2012-12-17 03:57:50+00:00)
Title: Fix boost_relevancy handling for some queries

Certain types of queries -- in particular, ones that consist of one set `OR`'ed fields that produce, under the hood, a ``query_obj`` that contain a single subquery -- were seeing their boosts (ones applied by ``boost_frequency``) being lost at execution time.

The reason for this was that when being normalised, this type of query finds itself being replaced (due to code at https://github.com/tow/sunburnt/blob/master/sunburnt/search.py#L175). This replacement causes any boosts applied with the `boost_relevancy` function to be be lost as they were originally only present on the top-level query.

This pull request avoids this behaviour during normalisation and adds tests accordingly. It also adds another test to check for results after multiple calls to boost_relevancy for a query.