    [cmr.common.config :as config]
    [cmr.common.util :as util :refer [are3]]
    [cmr.mock-echo.client.echo-util :as e]
-   [cmr.search.data.elastic-relevancy-scoring :as elastic-relevancy-scoring]
    [cmr.system-int-test.data2.core :as d]
    [cmr.system-int-test.data2.umm-spec-collection :as data-umm-c]
    [cmr.system-int-test.data2.umm-spec-common :as data-common]

     (is (= [0.65 0.5 0.5]
            (map :score (:refs (search/find-refs :collection {:keyword "Usage"})))))

     (dev-sys-util/eval-in-dev-sys `(elastic-relevancy-scoring/set-sort-bin-keyword-scores! true))

     (testing "bin size 0.1, same order"
       (dev-sys-util/eval-in-dev-sys `(elastic-relevancy-scoring/set-keyword-score-bin-size! 0.1))
       (is (d/refs-match-order? [coll1 coll2 coll3]
                                (search/find-refs :collection {:keyword "Usage"}))))

     (testing "bin size 0.2, order by usage"
       (dev-sys-util/eval-in-dev-sys `(elastic-relevancy-scoring/set-keyword-score-bin-size! 0.2))
       (is (d/refs-match-order? [coll2 coll1 coll3]
                                (search/find-refs :collection {:keyword "Usage"}))))

     (testing "bin size 0.3 - same as 0.2"
       (dev-sys-util/eval-in-dev-sys `(elastic-relevancy-scoring/set-keyword-score-bin-size! 0.3))
       (is (d/refs-match-order? [coll2 coll1 coll3]
                                (search/find-refs :collection {:keyword "Usage"})))))))



   (testing "Keyword, temporal, and usage"
     ;; No binning of community usage
     (dev-sys-util/eval-in-dev-sys `(cmr.search.data.elastic-relevancy-scoring/set-community-usage-bin-size! 1))
     (hu/ingest-community-usage-metrics sample-usage-csv)

     (are3 [expected-collections search-params]
