spicygreenbook/greenbook-app

Search Not Working Correctly

Opened this issue · 4 comments

Describe the bug
Searched for restaurants in Ashburn VA, and results show DC and Rockville first, Ashburn is 4th in the list.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://spicygreenbook.org/search?q=&near=ashburn+virginia
  2. See results

Expected behavior
Ashburn would have been first in the list and the others would not be returned (Ashburn to DC is 35 miles or so).

Screenshots
image

Desktop (please complete the following information):

  • OS: MAC
  • Browser Chrome
  • Version: Version 91.0.4472.101 (Official Build) (x86_64)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

To whomever starts to work on this. Even though the only user input on screen is "ashburn virginia" in the location field, I can see my browser console querying the database like this (I live in Houston, but have not entered that in the search box):

search info {q: "", near: "ashburn virginia", city: "Houston", state: "TX"}

I'm also not sure what sorting by "relevance" means, but one would assume that distance from searched city would be a factor in relevance.

To whomever starts to work on this. Even though the only user input on screen is "ashburn virginia" in the location field, I can see my browser console querying the database like this (I live in Houston, but have not entered that in the search box):

search info {q: "", near: "ashburn virginia", city: "Houston", state: "TX"}

I'm also not sure what sorting by "relevance" means, but one would assume that distance from searched city would be a factor in relevance.

@JeroenGoddijn I am can't speak to the sorting by relevance. Maybe @pleaseshutup can. I know it probably is a balance of checking how close of a match a listing is with distance, location entered, and any text input in the 'find' search box. When there no input in the 'find' search box do we recommend defaulting the search to sort by distance instead of relevancy score?

I have been working on this bug for a quite while and would like to give some updates:

  1. The search grabs the user's current location by default if the input is empty(unless you manually turn off location sharing)
  2. The sort by relevance completely depends on the rank score geo API gives us. Sorted by distance is currently not part of the relevancy score calculation. I am currently working on incorporating distance as part of the relevancy score.

@danilobatson Danilo, can you assign this issue to me?

bug fixed, suggest closing this issue.