Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2451

Enhance SolrTestCaseJ4 to allow tests to account for small deltas when comparing floats/doubles

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      Attached is a patch that adds the following method to SolrTestCaseJ4: (just javadoc & signature shown)

        /**
         * 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) {
      

      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.

        Attachments

        1. SOLR-2451.patch
          10 kB
          Hoss Man
        2. SOLR-2451.patch
          11 kB
          Hoss Man
        3. SOLR-2451_assertQScore.patch
          5 kB
          David Smiley
        4. Fix_SOLR-2451_for_a_custom_delta.patch
          2 kB
          David Smiley

          Issue Links

            Activity

              People

              • Assignee:
                hossman Hoss Man
                Reporter:
                dsmiley David Smiley
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: