Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Search Introduction

Taking about the current search page and what it's expected to perform

This documentation aims to explain mainly in the logic and backend end aspect. To reduce the difficulties of having hard time proving if the current behavior is correct or not. Let's get started.

Search Essentials, Filters and Sorting

Filters and sorting are essential features in search functionality that help users refine and organize search results to find the information they need more effectively. Here's an explanation of both:

Filters

Allow users to narrow down search results based on specific criteria (Tag) or attributes. These criteria are often associated with the data being searched. There are multiple ways to use our kept data for filter for the results

This method is the most easiest way to narrow down the user's search results. However, The challenge is Hungry Hub having more than hundreds of tags that can use as a search filter. Luckily we divided them into 12 categories, making it easier to use.

"All of 12 Tags Categories that we have in the system right now"

Restaurant Tags Filter hierarchy

OK, this is a good time to explain on another important topic, Restaurant Tags Filter hierarchy. Despite client side filter displayed seems like it's have a same level, but this filter function is having different hierarchy. For instance, Tags inside Cuisine and Dining Style categories is already well defined and distinct. Make it having less hierarchy level inside. So, if we try pressing "Cuisine", there will be individual (unique tag) to be selected as filter.

However, some categories is different, but yet close enough. Since they're referring to same topic, "Location". So, we group those categories together and label it as "Location" (will change name to "Place" in the future to reduce naming confusion.)

  • Tag Category Group (Tag Group); e.g. location
    1. Tag Category; e.g. dining style
      1. unique tag; e.g. Rooftop, Siam Paragon << This one is used as a Filter

Example

  • Rooftop is under tag category Dining Style.

    1. So the parent Tag category is Dining Style.
  • Siam Paragon is under tag category Shopping Mall

    1. Shopping Mall is refer to The Restaurant Location
    2. So the parent Tag category is Shopping Mall.
    3. And parent Tag Group will be Location

*For some reason "Other" Tag group on client side is unwell defined. It' having tags in multiple category inside, it will be handle by upcoming projects

2. Filters by using Restaurant Attribute

This is a little bit complicated from the previous one (but some how it's a lot shorter). Restaurant attribute can be constantly changing all the time. For example, review score. Also, it's have indirect attribute from linked package, like it's linked package type or package price (will refer as Restaurant service type). But it's still a powerful filter for user. Near Me Package Type

*Unlike Restaurant Tags, the restaurant attribute is not having hierarchy.

Combining the filters

After we know on the filter type and the hierarchy, to explain how filter combining logic should be is easier than ever.

  1. When combining filters between it's own parent, The logic that use for the results is OR. Let's say the filters that I've select is International (Cuisine) and Japanese (Cuisine), it's parent is both Cuisine. So, the result of the filter will have both International OR Japanese tagged restaurant.

  2. But when combining filters that having different parent, The logic that use for the results will be AND. So again, I select International(Cuisine) and Siam Paragon(Shopping Mall). International parent is Cuisine, but Siam Paragon parent is Shopping Mall. That's mean the result will be the restaurant That have the International cuisine AND tagged in Siam Paragon tag 2.1 Furthermore, If I applied another filter, Asok**.** Asok is under the Popular Zone category. That's mean Asok and Siam Paragon is having different parent Tag category, BUT those two higher hierarchy is under Tag Group, which is the same. *When select multiple tags filter within the same parent, it will having higher priority to narrow down search results. (Imagine it like mathematics)

So the result's for 2.1 is restaurant that have (Siam Paragon OR Asok) AND have International tagged

Checkpoint By this step, you have understands how the filters is working! Have some short break and Let's continue on the Sorting.

Sorting

Allows users to arrange search results in a specific order, making it easier to identify the most relevant items. Sorting options are typically related to how the data is displayed.

Sorting is Pretty Straightforward, In every search results with or without filters. The default sorting will be restaurant that having Ads first. Then there will be sorted by GMV gained from last 7 days. If no GMV for last 7 days, use numbers of reviews as lower priority instead

Override sorting

The choice of change sorting options depends on the specific user preferences.

We will have these sorting option for user

  • Most Relevance (Default Sorting)
    • Sorting by by outlet last 7 days GMV
    • If no GMV for last 7 days, use numbers of reviews as lower priority instead
  • Lowest Price
  • Highest Price
  • Most Loved
  • Most Booked
  • Nearest First (This one will also have shortcut for user to press)