This error is due to some results not having the board-slug set in the :_source map. This is a workaround: it tries to use the board-uuid if present and if the client knows which board is that and discards all results w/o a board-slug after this.
The ideal would be to load all the records in ES w/o a board-slug and re-index them.
To test (try to simulate a result w/o board-slug):
change oc.web.stores.search:36 to the lines you find down here
try using the search from the client
click on all the results
check that all works
check that the second result is omitted (simulate a result w/o board-slug where the board-uuid is not known, compare it with the query request or with this branch w/o modifications)
Replace line oc.web.stores.search/cleanup-results (line 50) with:
(defn- cleanup-results
"Entries have the uuid in this format: entry-0000-0000-0000-0000
replace those with only the UUID and make sure they have a board-slug,
if the slug is missing replace it with the board-uuid.
Finally filter out all the results that still don't have a board-slug."
[results]
(let [results (vec (for [i (range (count results))]
(cond
(= i 0)
(assoc (get results i) :board-slug nil)
(= i 1)
(-> (get results i)
(assoc :board-slug nil)
(assoc :board-uuid "1234-1234-1234")
:else
(get results i)))))]
(->> results
(mapv cleanup-result)
(filterv #(-> % :_source :board-slug seq)))))
Sentry: https://sentry.io/organizations/opencompany/issues/1551455336/?project=74293&referrer=slack
This error is due to some results not having the
board-slug
set in the:_source
map. This is a workaround: it tries to use the board-uuid if present and if the client knows which board is that and discards all results w/o a board-slug after this.The ideal would be to load all the records in ES w/o a board-slug and re-index them.
To test (try to simulate a result w/o board-slug):
oc.web.stores.search:36
to the lines you find down hereReplace line
oc.web.stores.search/cleanup-results
(line 50) with: