Category filter for nearby deals.

Issue #24 wontfix
Raymond Wells created an issue

Filtering by business category is a low priority issue, let's focus on the highs first.

Implement a by-category filter for businesses.

I'd hate to burst the bubble, but we can't filter categories 100% on the client side nor should we. The only way to feasibly do this (due to pagination), is to fetch a page, filter [O(n)], not enough items? Fetch next page, filter [O(n)], not enough? fetch next page.. etc etc etc...

So, how about what happens when there are 1 billion ads and no bar? We make 50,000,000 web requests if user selects 'bar' category. (1 billion ads / 20 ads per page = 5.0x10^8 pages)

It's actually easier on both android & the backend, more performant, and just all-around better, to let the database do this for you. After all, it's called elaticsearch.

You'll need to coordinate with me or @wmefteh on the backend to create an endpoint with the type of filtering/aggregation you'll need.

Comments (9)

  1. Raymond Wells reporter

    Sadly I don't think there will be time for this. Let's discuss it at the meeting today and close it as wontfix if it is decided.

  2. Log in to comment