lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] [Updated] (SOLR-2451) Add assertQScore() to SolrTestCaseJ4 to account for small deltas
Date Tue, 10 May 2011 23:09:47 GMT


Hoss Man updated SOLR-2451:

    Attachment: SOLR-2451.patch


One concern i have with your impl is that really only works with simple score comparisons
from the main result set -- for a public api we should probably try to be more general (as
is this wouldn't work if people wanted flexible score comparisons using group by for instance
-- let alone any custom plugins users might want to write tests for)

The underlying code that processes assertJQ already applies a tolerance level when doing equality
tests between the JSON structure and the expected value, but that is currently hardcoded.

Here's a patch bubbles that tollerance up that up so that it can be specified in the individual
assertJQ calls.  What do you think of this approach?

> Add assertQScore() to SolrTestCaseJ4 to account for small deltas 
> -----------------------------------------------------------------
>                 Key: SOLR-2451
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 3.2
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments: SOLR-2451.patch, SOLR-2451_assertQScore.patch
> Attached is a patch that adds the following method to SolrTestCaseJ4:  (just javadoc
& signature shown)
> {code:java}
>   /**
>    * Validates that the document at the specified index in the results has the specified
score, within 0.0001.
>    */
>   public static void assertQScore(SolrQueryRequest req, int docIdx, float targetScore)
> {code}
> This is especially useful for geospatial in which slightly different precision deltas
might occur when trying different geospatial indexing strategies are used, assuming the score
is some geospatial distance.  This patch makes a simple modification to DistanceFunctionTest
to use it.

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message