-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMR-9443: Reduce size of Elasticsearch query return on some calls wit…
…h unlimited page size (#2168) * Removing source from some cwic and opensearch ES searchs * Added a unit test * add newline * kondo changes
- Loading branch information
1 parent
37a1fbd
commit a518cfb
Showing
3 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
elastic-utils-lib/test/cmr/elastic_utils/test/es_index.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(ns cmr.elastic-utils.test.es-index | ||
"Tests for the cmr.elastic-utils.search.es-index namespace" | ||
(:require | ||
[clojure.test :refer [deftest is testing]] | ||
[cmr.elastic-utils.search.es-index :as es-index] | ||
[cmr.common.services.search.query-model :as qm] | ||
[cmr.elastic-utils.search.es-group-query-conditions :as gc])) | ||
|
||
(deftest test-query->execution-params | ||
(let [query->execution-params #'es-index/query->execution-params | ||
condition (gc/or-conds (map #(qm/string-conditions :consortiums [%]) | ||
["CWIC" "FEDEO" "GEOSS" "CEOS" "EOSDIS"]))] | ||
(testing "query include remove-source" | ||
(let [query (qm/query {:concept-type :collection | ||
:result-format :xml | ||
:condition condition | ||
:page-size :unlimited | ||
:remove-source true}) | ||
execution-params (query->execution-params query)] | ||
(is (= false | ||
(:_source execution-params))))) | ||
(testing "query doesn't include remove-source" | ||
(let [query (qm/query {:concept-type :collection | ||
:result-format :xml | ||
:condition condition | ||
:page-size :unlimited}) | ||
execution-params (query->execution-params query)] | ||
(is (not (= false | ||
(:_source execution-params)))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters