|
77 | 77 | concept-batches (db/find-concepts-in-batches db provider params (:db-batch-size system) start-index) |
78 | 78 | num-granules (index/bulk-index {:system (helper/get-indexer system)} |
79 | 79 | concept-batches |
| 80 | + cmr.elastic-utils.config/gran-elastic-name |
80 | 81 | {:target-index-key target-index-key})] |
81 | 82 | (info "Indexed" num-granules "granule(s) for provider" provider-id "collection" collection-id) |
82 | 83 | (when completion-message |
|
98 | 99 | params {:concept-type :granule |
99 | 100 | :provider-id provider-id} |
100 | 101 | concept-batches (db/find-concepts-in-batches db provider params (:db-batch-size system) start-index) |
101 | | - num-granules (index/bulk-index {:system (helper/get-indexer system)} concept-batches {})] |
| 102 | + num-granules (index/bulk-index {:system (helper/get-indexer system)} |
| 103 | + concept-batches |
| 104 | + cmr.elastic-utils.config/gran-elastic-name |
| 105 | + {})] |
102 | 106 | (info "Indexed" num-granules "granule(s) for provider" provider-id) |
103 | 107 | num-granules)) |
104 | 108 |
|
|
110 | 114 | params {:concept-type :collection |
111 | 115 | :provider-id provider-id} |
112 | 116 | concept-batches (db/find-concepts-in-batches db provider params (:db-batch-size system)) |
113 | | - num-collections (index/bulk-index {:system (helper/get-indexer system)} concept-batches {})] |
| 117 | + num-collections (index/bulk-index {:system (helper/get-indexer system)} |
| 118 | + concept-batches |
| 119 | + cmr.elastic-utils.config/non-gran-elastic-name |
| 120 | + {})] |
114 | 121 | (info "Indexed" num-collections "collection(s) for provider" provider-id) |
115 | 122 | num-collections)) |
116 | 123 |
|
|
128 | 135 | gran-count |
129 | 136 | provider-id))) |
130 | 137 |
|
| 138 | +;; TODO CMR-10636 fix this. We need to separate out the concepts and go to each seperate cluster |
131 | 139 | (defn- bulk-index-concept-batches |
132 | 140 | "Bulk index the given concept batches in both regular index and all revisions index." |
133 | 141 | [system concept-batches] |
134 | 142 | (let [indexer-context {:system (helper/get-indexer system)}] |
135 | | - (index/bulk-index indexer-context concept-batches {:all-revisions-index? true}) |
136 | | - (index/bulk-index indexer-context concept-batches {}))) |
| 143 | + (index/bulk-index indexer-context concept-batches nil {:all-revisions-index? true}) |
| 144 | + (index/bulk-index indexer-context concept-batches nil {}))) |
137 | 145 |
|
138 | 146 | (defn- index-concepts-by-provider |
139 | 147 | "Bulk index concepts for the given provider and concept-type." |
|
246 | 254 | {:concept-type concept-type :concept-id batch} |
247 | 255 | (:db-batch-size system))] |
248 | 256 | concept-batch) |
249 | | - total (index/bulk-index {:system (helper/get-indexer system)} concept-batches)] |
| 257 | + total (index/bulk-index {:system (helper/get-indexer system)} concept-batches nil)] |
250 | 258 |
|
251 | 259 | ;; for concept types that have all revisions index, also index the all revisions index |
252 | 260 | (when-not (#{:tag :granule} concept-type) |
253 | 261 | (index/bulk-index |
254 | | - {:system (helper/get-indexer system)} concept-batches {:all-revisions-index? true})) |
| 262 | + {:system (helper/get-indexer system)} concept-batches nil {:all-revisions-index? true})) |
255 | 263 |
|
256 | 264 | (info "Indexed " total " concepts.") |
257 | 265 | total)) |
|
281 | 289 | {:concept-type concept-type :concept-id batch} |
282 | 290 | (:db-batch-size system))] |
283 | 291 | (map #(assoc % :deleted true) concept-batch)) |
284 | | - total (index/bulk-index {:system (helper/get-indexer system)} concept-batches)] |
| 292 | + total (index/bulk-index {:system (helper/get-indexer system)} concept-batches nil)] |
285 | 293 | (info "Deleted " total " concepts") |
286 | 294 | total)) |
287 | 295 |
|
|
0 commit comments