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

Allow to filter search results based on one country and one or several stores #99

Closed
2 tasks
Tracked by #1284 ...
teolemon opened this issue Jan 18, 2021 · 8 comments
Closed
2 tasks
Tracked by #1284 ...

Comments

@teolemon
Copy link
Member

teolemon commented Jan 18, 2021

What

Part of

@teolemon teolemon changed the title Allow to filter search results based on one country Allow to filter search results based on one country and one or several stores Jan 18, 2021
@monsieurtanuki
Copy link
Contributor

@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?

@teolemon
Copy link
Member Author

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

@monsieurtanuki
Copy link
Contributor

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?

@stephanegigandet
Copy link
Contributor

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.

@monsieurtanuki
Copy link
Contributor

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),
  ),
);

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Feb 5, 2021

@teolemon
Copy link
Member Author

teolemon commented Jan 8, 2022

We now have a country selector.

@teolemon teolemon added this to the V2 milestone Apr 11, 2022
@teolemon
Copy link
Member Author

teolemon commented Aug 7, 2022

@teolemon teolemon closed this as completed Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants