<<

NAME

search.pl - Search products

DESCRIPTION

CGI script to search products.

This script displays the search form, and processes the search request.

Search URL example:

/cgi/search.pl?action=display&tagtype_0=categories&tag_contains_0=contains&tag_0=smartphones&sort_by=unique_scans_n&page_size=20&axis_x=ingredients_n&axis_y=unknown_ingredients_n&graph=1&action=display

Graphs

Search results can be displayed as graphs (histograms or scatter plots), by passing the following parameters:

 graph=1
 axis_x=FIELD_NAME
 axis_y=FIELD_NAME

The axis can be: - a nutrient - other product fields: number of ingredients, number of known ingredients, number of unknown ingredients, product quantity, nova group, environmental score, packaging materials weights - a Folksonomy Engine property: e.g. manufacturer_suggested_retail_price:eu:eur (the value must be numeric)

Folksonomy Engine properties

Folksonomy Engine properties can be used as axis by passing the property value prefixed by folksonomy (e.g. axis_x=folksonomy.manufacturer_suggested_retail_price:eu:eur). Or axis_x=folksonomy and an additional axis_x_folksonomy_property (easier for the search form) (e.g. axis_x=folksonomy&axis_x_folksonomy_property=manufacturer_suggested_retail_price:eu:eur).

The current (October 2025) Folksonomy Engine API does not allow getting the list of properties for multiple barcodes.

The current strategy is to: - get all the products matching the search criteria from the Product Opener database (MongoDB or off-query) - get all products having the Folksonomy Engine property set - filter the products matching both criteria

<<