openfoodfacts / openfoodfacts-dart

Open Food Facts API Wrapper
https://pub.dev/packages/openfoodfacts
Apache License 2.0
168 stars 67 forks source link

Implement the new ElasticSearch search endpoint #833

Open teolemon opened 1 year ago

teolemon commented 1 year ago

Why - Problem description

### Routes
- [ ] /document/{identifier}
- [ ] https://github.com/openfoodfacts/openfoodfacts-dart/issues/841
- [ ] /autocomplete
### Schemas
- [ ] ErrorSearchResponseExpand allobject
- [ ] HTTPValidationErrorExpand allobject
- [ ] SearchResponseDebugExpand allobject
- [ ] SearchResponseErrorExpand allobject
- [ ] SuccessSearchResponseExpand allobject
- [ ] ValidationErrorExpand allobject
### Sub-issues already opened
- [ ] #620 
- [ ] #619 

Related issue in the official mobile app

monsieurtanuki commented 12 months ago

My first tests show some problems/questions.

parameter discrepancies

In the current version

  1. we pass the country as a parameter => shouldn't we do so Elastic Search?
  2. we pass app_name as a parameter => shouldn't we do so Elastic Search?
  3. we pass the user name in the http header => shouldn't we do so Elastic Search?

product structure discrepancies

In the current version

  1. the "brands" product field is a comma-separated String, and in Elastic Search it's a List<String>. => it probably means that we need a specific new Product class.