Line 105: |
Line 105: |
| === Example === | | === Example === |
| | | |
− | * Request: https://world.openfoodfacts.org/api/v0/product/3700214614266?fields=product_name,code,attribute_groups_en | + | * Request: https://world.openfoodfacts.org/api/v2/product/3700214614266?fields=product_name,code,attribute_groups_en |
| * Response: | | * Response: |
| | | |
Line 185: |
Line 185: |
| | | |
| Based on the users preferences and the "match" key of the Product Attributes, apps can exclude some results (e.g. if a mandatory requirement is not fully met) and re-rank search results. | | Based on the users preferences and the "match" key of the Product Attributes, apps can exclude some results (e.g. if a mandatory requirement is not fully met) and re-rank search results. |
| + | |
| + | For each attribute, the server computes a match that goes from 0 to 100 (perfect match). |
| | | |
| The filtering and ranking is done on the client, the preferences are not sent to the server. | | The filtering and ranking is done on the client, the preferences are not sent to the server. |
| | | |
− | Sample client-side algorithm to compute a user defined sort key:
| + | Client-side (Open Food Facts website + Smoothie app) algorithm to compute a user defined sort key: |
| | | |
| * for each requirement in user preferences | | * for each requirement in user preferences |
Line 231: |
Line 233: |
| * Origin Country | | * Origin Country |
| ** in percent of weight of the final product | | ** in percent of weight of the final product |
| + | |
| + | = Product Attributes for Contributors = |
| + | |
| + | * Special [[Product Attributes for Contributors]] |
| | | |
| [[Category:Project:Personalized_Search]] | | [[Category:Project:Personalized_Search]] |
| [[Category:ProductOpener]] | | [[Category:ProductOpener]] |