Optional
init: RequestInitOptional
init: RequestInitOptional
init: RequestInitOptional
fuzziness?: null | numberOptional
index_id?: null | stringOptional
lang?: stringOptional
size?: numberOptional
query: { index_id?: null | string }Optional
index_id?: null | stringOptional
query: {Optional
display_debug?: booleanOptional
index_id?: null | stringOptional
langs?: stringOptional
page?: numberOptional
page_size?: numberOptional
q?: null | stringOptional
sort_by?: null | stringOptional
charts?: Charts
Optional
facets?: null | string[]Facets
Optional
fields?: null | string[]Fields
Optional
index_id?: null | 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
Optional
q?: null | 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.
Optional
sort_by?: null | 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
Optional
sort_params?: null | Record<string, never>Sort Params
Optional
charts?: stringOptional
facets?: stringOptional
fields?: stringOptional
index_id?: null | stringOptional
langs?: 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.
Optional
page?: numberOptional
page_size?: numberOptional
q?: null | 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.
Optional
sort_by?: null | 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