Skip to content

Optimize search

Matthias Larisch requested to merge optimize-search into master

What does this MR do?

  • Modifies logic to find people for a new conversation (See https://yunity.slack.com/archives/C1T1ZM9A4/p1589466951343800 for discussion)

    • Now, it includes everybody of the regions you are in, that are NOT of type State or Country (e.g. that ARE of types that are typically to be used for picking up/working like city, district, working group). This exclusion should always have happened but was overridden by adding people to their state/country groups a year ago.
    • For ambassadors, it also includes regions/working groups they are ambassador/admin for as well as all sub regions of that without type check
    • For orga and ambassador welcome team, it includes all users including food sharers (which is new, previously there was a filter on foodsavers. Maybe to be removed again when people complain about too many results)
  • Uses fulltext match .. against SQL instead of LIKE for a massive speedup. By that, we lose the ability to filter for short words or do non-prefix searches, e.g. words with less than 3 characters are just ignored (MySQL configuration, could be tuned), and search strings need to match from the beginning of a word: Matthias can only be matched by searching for matt, not by searching for hias anymore.

  • ToDo: There is optimization potential I didn't use yet because I did not want to touch a core method of hierarchical region querying. It is on my personal todo list for a followup after the release :-)

How confident are you it won't break things if deployed?

Unit test for the actual search and manually played with the logic for region selection. Still, would like some beta testers to confirm region selection logic. In any case, it cannot become worse than it was :-)

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • joined #foodsharing-beta channel at https://slackin.yunity.org
  • added an entry to CHANGELOG.md (description, merge request link, username(s))
  • Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings
Edited by Matthias Larisch

Merge request reports