IFRCGo / go-frontend

MIT License
21 stars 5 forks source link

Search result page #2595

Closed tovari closed 1 year ago

tovari commented 1 year ago

The search result page will be loaded, when the user add search term in the Search field and also hits enter. Without hitting Enter, only the limited list of instant results pops up under the search field (as the current functionality).

The search result page design: https://www.figma.com/file/u0XifdJwTEx165x3e0eoP9/IFRC-GO_UI-Prototype?node-id=9710%3A157300&t=iQmZepn0CI7aYqmC-0 wireframes: https://www.figma.com/proto/uRgMamNHRi5KhhroYDwuxN/IFRC-GO---Wireframes?node-id=10393%3A31790&scaling=min-zoom&page-id=0%3A72&starting-point-node-id=111%3A0&show-proto-sidebar=1

https://www.figma.com/file/uRgMamNHRi5KhhroYDwuxN/IFRC-GO---Wireframes?node-id=10393%3A31790&t=BwQTdtSvakiHvZLH-4

The order of result lists per content type:

  1. Country, Region
  2. Emergencies
  3. Appeals
  4. 3W projects
  5. Surge Alerts
  6. Surge deployments
  7. Reports

Need to be able to search in the following attributes of each content type: https://ifrcorg.sharepoint.com/:x:/r/sites/GOIVfordeveloperteam/Shared%20Documents/General/GO%202022/GO%20IM%20Sprint%20-%20September%20-%20Nepal/Search_functionality.xlsx?d=w90d23166bc544907868ed2f962fbf42f&csf=1&web=1&e=R4mPWr image

udaynwa commented 1 year ago

@tovari , could you please clarify what documents are to be shown in the 'EMERGENCY PLANNING AND REPORTING DOCUMENTS' section of the new Search results page? image

cc @frozenhelium

tovari commented 1 year ago

As we discussed during the kick-off call:

Anything to add @mariam-yu ?

mariam-yu commented 1 year ago

@tovari summarized perfectly!

udaynwa commented 1 year ago

Thank you for the summarization, @tovari.

udaynwa commented 1 year ago

@mariam-yu @tovari , is the expected behavior the same for both of the 'Search' bars? The behavior being; 'The search result page will be loaded, when the user add search term in the Search field and also hits enter. Without hitting Enter, only the limited list of instant results pops up under the search field (as the current functionality).'

If they're not, could you please elaborate the expected behavior of the lower search bar?

image

tovari commented 1 year ago

@udaynwa, as @mariam-yu explained to me, the purpose of this search field is to provide an entry field for modified/updated search terms. So the expected behavior:

@mariam-yu, should we also implement the instant search results in a drop-down just as in the top search field? We may start without this functionality, I think.

mariam-yu commented 1 year ago

@tovari Thanks for summarizing. I kept forgetting to respond to this, and the way you did it it's perfect. I think we can start without the type ahead. It may be later expected, since it's the same functionality as the nav search, but best to do step by step and test it out.

frozenhelium commented 1 year ago

Very initial version available on test server: https://ifrc-go-feature-search.surge.sh/

tovari commented 1 year ago

Thanks. A few notes:

Alert Date Duration Start Date Position Keywords Emergency Country Status

Thanks! cc: @mariam-yu

udaynwa commented 1 year ago

@tovari , a quick question on 'Crisis categorization' in the Emergencies section. Is 'disaster_type' the 'Crisis categorization'?

cc @frozenhelium

tovari commented 1 year ago

Crisis or disaster categorization is the 'ifrc_severity_level', which can be Yellow, Orange or Red: image

mariam-yu commented 1 year ago

@udaynwa @tovari A few comments on the Search page:

Designs: https://www.figma.com/proto/u0XifdJwTEx165x3e0eoP9/IFRC-GO_UI-Prototype?page-id=0%3A4957&node-id=9710%3A157300&viewport=670%2C16539%2C0.4&scaling=scale-down-width&starting-point-node-id=0%3A4963&hide-ui=1

Also, as we are on the topic, a few comments for the main Search in the nav:

@tovari I think we should do a quick test with some users to get feedback. Also, think we may need to review the columns for tables and whether it's too table heavy, but otherwise, it's great @udaynwa and team. Super addition.

udaynwa commented 1 year ago

Thanks for your feedback and suggestions, @mariam-yu . We'll start with the items that do not need discussions and are straight forward.

One initial reply;

tovari commented 1 year ago

Thanks @mariam-yu for the review. > * EMERGENCY PLANNING AND REPORTING DOCUMENTS always shows Appeal under Type. Does it say Appeal for DREF too? Also, i think we should rename that to make it simpler and not to confuse with "Reports". I suggest Emergency Documents. @tovari Thoughts?

DREF is technically an appeal as well. There might be documents at DREF, like Ops Learning and Final report. Honestly, I'm not sure, if the Emergency planning and reporting documents section is very useful at the moment. The related emergencies can be found anyway in the Emergencies section, so the user can easily navigate to the related reports. Secondly, there might be a lot of document at each emergency which makes the result list potentially too long and difficult to prioritize the most relevant docs. Thirdly, we don't have yet the capability to search in documents at all, not even for tags, so it won't be able to bring additional value. I think, we should ask more people about this.

>If no matches, should we say no matches for your search? Now, it's always showing something (@tovari what do you think?). May be a better direction would be to say No matches for your search, but still show some suggestions below, since I assume it's still pulling the closest match?

I like this idea, would be great to see some close results even when there is no exact search result.

> * When I type, say, Madera, Reports come first, thought Emergencies should always be first, since multiple matches. Also, @tovari thoughts on Calling this operations instead of Emergencies?

For some reason the score is higher for FR, I guess. I tend to think that we should follow the pre-defined order of sections. Not sure though.

> @tovari I think we should do a quick test with some users to get feedback. Also, think we may need to review the columns for tables and whether it's too table heavy, but otherwise, it's great @udaynwa and team. Super addition.

Indeed. I suggested already a few updates on the table columns to match tables on other GO pages. I assume, it would bring the most relevant ifo and consistency.

batpad commented 1 year ago

They're sorted on the basis of their score. Not the latest first.

I like this idea, would be great to see some close results even when there is no exact search result.

For some reason the score is higher for FR, I guess. I tend to think that we should follow the pre-defined order of sections. Not sure though.

Sooo ... this scoring, relevance and ranking of results is going to be a long rabbit hole and lots of tuning we can do. The "relevancy score" calculated is all a bit of magic, and django haystack / ElasticSearch gives us a lot of levers to turn to tune relevancy of matches, but that will likely be a constant process that we improve, and we shouldn't try and get the relevancy stuff to be "perfect" to deploy this. We should discuss this though: an alternate approach would be to not really use the relevancy score to order results, and just order by a pre-defined parameter for each section, like date. I kind've like the idea of continuing to use "score" and then continue to tweak parameters to make things we want to show up come up. Let's discuss on dev call a bit.

When I type in Africa, it shows: Country: Afghanistan.

There's a few cases where you can search for something and can be unsure of why a result has appeared. This is because there are a lot of fields that we are using to search through, but are not displaying in the result. As far as possible, we should try and include all the fields that are being searched for an entity, in the result / display on the search results page. We should do this as a first step. As a next step, we might want to look into some helpers in django haystack that would allow us to pull up the relevant text where the search result was matched, show a snippet with the matched word AND highlight the matched word so it's very clear when viewing a result, why your search corresponds to a certain result. Again, getting to the "perfect" solution here is a bunch of work, so let's figure out a good in between to be able to release, and then ticket out improving things.

mariam-yu commented 1 year ago

@batpad and @udaynwa I was thinking that the tables are selected based on the score (i.e. first match is an emergency, so we show the emergencies table), but then we sort by date. Actually, by score and then by date. For example, if we search for something generic like Philippines, then the result can be equal across, since it's an equal match to emergencies, reports, etc. So, in this case the sorting should happen based on our list (i.e. emergencies first), and within emergencies table we sort by latest first, since all the operations will have "Philippines" in them.

However, when searching for a more specific combination, we can prioritize the score both in tables and within tables. Is this doable? (cc @tovari for your point too).

Then @tovari I think we still need the documents section, since I think people a lot of times will be looking for a specific appeal or DREF file and having it here will help them get to it faster, rather than through the EM page. But may be instead of EM docs we just show Appeal docs? not sure if anyone would be looking for other EM docs (they may though). It's just the Appeal type is not a useful column if it always says Appeal. I think it's the type of Appeal, is it DREF or others. Not sure if currently it has that categorization. Thanks!

tovari commented 1 year ago

Some of the links in the table contains /search/ part, which breaks the link:

Please also change the Country names to bold fonts in Surge Deployments.

tovari commented 1 year ago

Emergencies:

Reports:

Open Surge Alerts:

Surge Deployments:

tovari commented 1 year ago

Emergency planning and reporting -

Feedback option

udaynwa commented 1 year ago

@tovari , for this;

Flash updates are not searchable

The Flash updates are actually searchable at the moment. We have limited the number of results to 50, so the Flash Updates are not showing up in the results since Field Reports in the results have more scores than Flash Updates.

Here is an screenshot: image (20)

And here is the link of the results: https://go-stage.ifrc.org/search/?keyword=Switzerland

cc @frozenhelium

tovari commented 1 year ago

A few more tiny updates before the release:

udaynwa commented 1 year ago

@tovari , we have implemented the above-listed updates. They can be verified on Staging.

For the 3rd point, we are now showing the countries like this in a pop-up; image

Let us know what you think about it.

cc @frozenhelium