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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.2, 4.0-ALPHA
    • None
    • 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_assertQScore.patch
          5 kB
          David Smiley
        2. SOLR-2451.patch
          10 kB
          Chris M. Hostetter
        3. SOLR-2451.patch
          11 kB
          Chris M. Hostetter
        4. Fix_SOLR-2451_for_a_custom_delta.patch
          2 kB
          David Smiley

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              dsmiley David Smiley
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: