Optionalinit: RequestInitOptionalinit: RequestInitOptionalfuzziness?: numberOptionalindex_id?: stringOptionallang?: stringOptionalsize?: numberOptionalquery: { index_id?: string }Optionalindex_id?: stringOptionalquery: {Optionaldisplay_debug?: booleanOptionalindex_id?: stringOptionallangs?: stringOptionalpage?: numberOptionalpage_size?: numberOptionalq?: stringOptionalsort_by?: stringOptionalcharts?: (Charts
Optionalfacets?: string[]Facets
Optionalfields?: string[]Fields
Optionalindex_id?: stringIndex Id
Langs
List of languages we want to support during search. This list should include the user expected language, and additional languages (such as english for example).
This is currently used for language-specific subfields to choose in which
subfields we're searching in.
If not provided, `['en']` is used.
Page
Page Size
Optionalq?: stringQ
The search query, it supports Lucene search query syntax (https://lucene.apache.org/core/3_6_0/queryparsersyntax.html). Words that are not recognized by the lucene query parser are searched as full text search.
Example: `categories_tags:"en:beverages" strawberry brands:"casino"` query use a
filter clause for categories and brands and look for "strawberry" in multiple
fields.
The query is optional, but `sort_by` value must then be provided.
Optionalsort_by?: stringSort By
Field name to use to sort results, the field should exist and be sortable. If it is not provided, results are sorted by descending relevance score.
If you put a minus before the name, the results will be sorted by descending order.
If the field name match a known script (defined in your configuration),
it will be use for sorting.
In this case you also need to provide additional parameters corresponding to your script parameters.
If a script needs parameters, you can only use the POST method.
Beware that this may have a big [impact on performance][perf_link]
Also bare in mind [privacy considerations][privacy_link] if your script parameters contains sensible data.
[perf_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations
[privacy_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations
Optionalsort_params?: Record<string, unknown>Sort Params
Optionalcharts?: stringOptionalfacets?: stringOptionalfields?: stringOptionalindex_id?: stringOptionallangs?: stringList of languages we want to support during search. This list should include the user expected language, and additional languages (such as english for example).
This is currently used for language-specific subfields to choose in which
subfields we're searching in.
If not provided, `['en']` is used.
Optionalpage?: numberOptionalpage_size?: numberOptionalq?: stringThe search query, it supports Lucene search query syntax (https://lucene.apache.org/core/3_6_0/queryparsersyntax.html). Words that are not recognized by the lucene query parser are searched as full text search.
Example: `categories_tags:"en:beverages" strawberry brands:"casino"` query use a
filter clause for categories and brands and look for "strawberry" in multiple
fields.
The query is optional, but `sort_by` value must then be provided.
Optionalsort_by?: stringField name to use to sort results, the field should exist and be sortable. If it is not provided, results are sorted by descending relevance score.
If you put a minus before the name, the results will be sorted by descending order.
If the field name match a known script (defined in your configuration),
it will be use for sorting.
In this case you also need to provide additional parameters corresponding to your script parameters.
If a script needs parameters, you can only use the POST method.
Beware that this may have a big [impact on performance][perf_link]
Also bare in mind [privacy considerations][privacy_link] if your script parameters contains sensible data.
[perf_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations
[privacy_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations
MDN Reference