IFRCGo/go-frontend

[PROD] FR form - Emergency search field

Closed this issue · 7 comments

The emergency search field on the Field Report form doesn't provide all relevant emergencies.
https://go.ifrc.org/reports/new

Sample emergencies not showing up in the field:
VEN: Anticipatory Action operation
ISR: Civil Unrest - 2023-09 - Eritrean irregular migrants civil unrest in Tel Aviv
ZAF: Fire - 2023-08 - Structured Fires in Johannesburg city
CUB: Cyclone - 2023-08 - Huracan Idalia Cuba

Due to the issue, users cannot attach filed reports to existing emergencies, thus they create new emergencies, which is not ideal.

A full site elasticsearch index update was run.
After that "ISR: Civil Unrest - 2023-09..." appears in searches, but the other 3 not.
Investigating the reason...
It would be good to check if "CUB: Cyclone - 2023-08 - Huracan Idalia Cuba" event (id: 6633) is there in index or not.

cc @thenav56 @samshara - would be great to get your eyes here to see if there's any ideas of what might be happening here.

This should be a permission issue.
After setting the mentioned "CUB:..." event (from Membership) to Public (and indexing), it was found:
kép
but after setting it back to Membership (and indexing):
kép

This last search should also find the Huracan Idalia, due to I was logged in (as a member).

Is it possible that in the search request no user identification (no token) arrives from frontend to backend, so no chance to have other query than public ones? @frozenhelium

In debug of HayStackSearch:
if self.request.user.is_authenticated:

p self.request.user
<django.contrib.auth.models.AnonymousUser object at ...>

The reason for this last one can be an imperfect index update. After a manual update of search indices it can be found:
kép