Allow to filter search results based on one country and one or several stores
teolemon opened this issue · 8 comments
What
- Allow to filter search results based on one country and one or several stores. Add an onboarding screen to confirm that country (guess based on phone locale), propose stores based on country using
- https://static.openfoodfacts.org/data/taxonomies/stores.json
Part of
@teolemon There are obvious problems with accents in https://static.openfoodfacts.org/data/taxonomies/stores.json
Where will the filter happen: in the query itself (additional API parameters) or when we get the results?
Let's perhaps drop stores (it doesn't have country for stores anyway) and only keep country filtering (we could use the system's country list, or Open Food Fact's : https://static.openfoodfacts.org/data/taxonomies/countries.json
Beyond the "just the country, not the stores" simplification, I still have the same question:
Where will the filter happen: in the query itself (additional API parameters) or when we get the results?
I think we should do the reverse: by default, search only products for the current country, and offer to widen the search to the world, as we do on the web site.
The filter should happen in the query.
How should we add the country parameter in the query?
For instance, in KeywordsProductQuery
, I assume it's in ProductSearchQueryConfiguration
, but how?
await OpenFoodAPIClient.searchProducts(
ProductQuery.SMOOTH_USER,
ProductSearchQueryConfiguration(
fields: ProductQuery.fields,
parametersList: <Parameter>[
const PageSize(size: 500),
TagFilter(
tagType: 'categories',
contains: true,
tagName: keywords,
)
],
language: LanguageHelper.fromJson(languageCode),
),
);
- related to #133
We now have a country selector.