-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Allow to filter search results based on one country and one or several stores #99
Comments
@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: |
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? 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),
),
); |
|
We now have a country selector. |
|
What
Part of
The text was updated successfully, but these errors were encountered: