   (let [psa1 (dc/psa "alpha" :string)
         psa2 (dc/psa "bravo" :string)
         psa3 (dc/psa "charlie" :string)
-
         coll1 (d/ingest "PROV1" (dc/collection {:product-specific-attributes [psa1 psa2]}))
         gran1 (d/ingest "PROV1" (dg/granule coll1 {:product-specific-attributes [(dg/psa "alpha" ["ab" "bc"])
                                                                                  (dg/psa "bravo" ["cd" "bf"])]}))

       (= {:status 422 :errors [error]}
          (search/get-search-failure-data (search/find-refs :granule {"attribute[]" v})))
       ",alpha,a" (am/invalid-type-msg "")
       ",alpha,a,b" (am/invalid-type-msg "")
       "string,,a" (am/invalid-name-msg "")
       "string,,a,b" (am/invalid-name-msg "")

           ;; only max range provided
           "string,bravo,,bc" [gran2 gran3]))))

(deftest float-psas-search-test
  (let [psa1 (dc/psa "alpha" :float)
        psa2 (dc/psa "bravo" :float)
        psa3 (dc/psa "charlie" :float)
        coll1 (d/ingest "PROV1" (dc/collection {:product-specific-attributes [psa1 psa2]}))
        gran1 (d/ingest "PROV1" (dg/granule coll1 {:product-specific-attributes [(dg/psa "alpha" [10.5 123])
                                                                                 (dg/psa "bravo" [-12])]}))
        gran2 (d/ingest "PROV1" (dg/granule coll1 {:product-specific-attributes [(dg/psa "bravo" [10.5 123])]}))

        coll2 (d/ingest "PROV1" (dc/collection {:product-specific-attributes [psa1 psa2 psa3]}))
        gran3 (d/ingest "PROV1" (dg/granule coll2 {:product-specific-attributes [(dg/psa "alpha" [14])
                                                                                 (dg/psa "bravo" [13.7 123])]}))
        gran4 (d/ingest "PROV1" (dg/granule coll2 {:product-specific-attributes [(dg/psa "charlie" [14])]}))]
    (index/flush-elastic-index)

    (testing "search by value"
      (are [v items]
           (d/refs-match? items (search/find-refs :granule {"attribute[]" v}))
           "float,bravo,123" [gran2, gran3]
           "float,alpha,10" []
           "float,bravo,-12" [gran1]))

    (testing "search by range"
      (are [v items]
           (d/refs-match? items (search/find-refs :granule {"attribute[]" v}))

           ;; inside range
           "float,alpha,10.2,11" [gran1]
           ;; beginning edge of range
           "float,alpha,10.5,10.6" [gran1]
           ;; ending edge of range
           "float,alpha,10,10.5" [gran1]

           ;; only min range provided
           "float,bravo,120," [gran2 gran3]

           ;; only max range provided
           "float,bravo,,13.6" [gran2]))))





