Skip to content

Allow to search keys #19

@CharlesNepote

Description

@CharlesNepote

We will probably have thousands of properties and we need to make them easy to find.

For the end-user, the best option would be to enter a keyword related to the property he wants to add.

Example: searching how to enter the color of the cap:

  • the user enter "c", then "o", then "l"
  • the UI should provide a list containing properties (or descriptions) containing "co" then "col"

The GET /keys is currently returning all the keys with stats:

  • the stats are not useful for our current concern
  • returning ALL the keys might be costly when there are thousands of properties

Currently, Open Food Facts website is already using tags autocompletion with a library (tagify) that takes simple JSON arrays in input ["tag1","tag2","free_tag"] (see the explanation here).

Suggestion 1

Create a GET /keys&term=col which returns a simple JSON array: ["color","color_of_the_cap","multicolor"].

Suggestion 2

Create another API route to return only the useful data:

  • rename GET /keys into /key_stats
  • create GET /keys&term=col which returns a simple JSON array: ["color","color_of_the_cap","multicolor"].

Part of

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions