Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 5568 - optimized search for price locations #5587

Merged
merged 6 commits into from
Sep 25, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • The location search for prices could lead to prices linked to locations that are no shops at all (e.g. a road).
  • In our location search, we can filter on shops and amenities, which brings much more relevant results, especially for cases with ambiguous terms like "carrefour paris", and that will cover the big majority of our expected locations.
  • But in some cases, shops are not tagged as shops, but as buildings.
  • The solution is to start with expected results (shop and amenity), and to let the user enlarge the search if needed.

Screenshots

optimized search optimized+broader
Screenshot_1726128053 Screenshot_1726128060

Fixes bug(s)

Impacted files

  • app_en.arb: added a label for "location broader search"
  • app_fr.arb: added a label for "location broader search"
  • dao_osm_location.dart: added columns osmKey and osmValue
  • local_database.dart: upgraded the version in order to add columns to location table
  • location_list_supplier.dart: added optional parameters for optimized search; added fields osmKey and osmValue
  • location_query_model.dart: now we use 2 suppliers - optimized and broader
  • location_query_page.dart: now display optimized results first, then broader results after a button click
  • osm_location.dart: added fields osmKey and osmValue

Impacted files:
* `app_en.arb`: added a label for "location broader search"
* `app_fr.arb`: added a label for "location broader search"
* `dao_osm_location.dart`: added columns osmKey and osmValue
* `local_database.dart`: upgraded the version in order to add columns to location table
* `location_list_supplier.dart`: added optional parameters for optimized search; added fields osmKey and osmValue
* `location_query_model.dart`: now we use 2 suppliers - optimized and broader
* `location_query_page.dart`: now display optimized results first, then broader results after a button click
* `osm_location.dart`: added fields osmKey and osmValue
@monsieurtanuki
Copy link
Contributor Author

cc @raphodn

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 47 lines in your changes missing coverage. Please review.

Project coverage is 6.94%. Comparing base (4d9c7fc) to head (871b6b9).
Report is 323 commits behind head on develop.

Files with missing lines Patch % Lines
...ooth_app/lib/data_models/location_query_model.dart 0.00% 14 Missing ⚠️
...h_app/lib/pages/locations/location_query_page.dart 0.00% 14 Missing ⚠️
...th_app/lib/data_models/location_list_supplier.dart 0.00% 7 Missing ⚠️
...ages/smooth_app/lib/database/dao_osm_location.dart 0.00% 7 Missing ⚠️
...s/smooth_app/lib/pages/locations/osm_location.dart 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5587      +/-   ##
==========================================
- Coverage     9.54%   6.94%   -2.60%     
==========================================
  Files          325     402      +77     
  Lines        16411   21238    +4827     
==========================================
- Hits          1567    1476      -91     
- Misses       14844   19762    +4918     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@teolemon teolemon requested a review from a team September 20, 2024 14:38
@monsieurtanuki monsieurtanuki merged commit 8e5ea75 into openfoodfacts:develop Sep 25, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon @g123k for your reviews!

@raphael0202 @raphodn As discussed less than a month ago, the location search needed to be improved.
Now, our algorithm for location search by terms in Smoothie is:

  • filter on shop and amenity, in order to have the most relevant results
  • if needed (e.g. obvious shop not found), let the user remove that filter and search again

I don't know if it's the method you're currently implementing for the web app. Feel free to make suggestions!

@raphael0202
Copy link

I don't know if it's the method you're currently implementing for the web app. Feel free to make suggestions!

I think it's amenity/shops only on the web app, but to be confirmed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Price/proof addition : location field : restrict OSM types
5 participants