z_search_props (zotonic_core v1.0.0-rc.17)
Map query args to query maps and vice versa. Special backwards compatible handling for repeating terms with the same name.
Summary
Functions
Add default search terms if they do not exist in the original query terms.
Translate the query arguments to a query term map. Drops query terms with empty values, as unselected or empty inputs in search forms can post empty values.
Translate a map with query term keys to a query term map.
Translate the query arguments to a query term map.
Translate a stored query text to a query term map.
Functions
Add default search terms if they do not exist in the original query terms.
-spec from_list(Args) -> Query when Args :: [KeyValue], KeyValue :: {Key, Value} | Key | list(), Key :: binary() | atom(), Value :: binary() | number() | boolean() | list(), Query :: map().
Translate the query arguments to a query term map. Drops query terms with empty values, as unselected or empty inputs in search forms can post empty values.
Translate a map with query term keys to a query term map.
-spec from_qargs(QArgs) -> Query when QArgs :: z:context() | [{Key, Value}], Key :: binary() | atom(), Value :: binary() | number() | boolean() | list(), Query :: map().
Translate the query arguments to a query term map.
Translate a stored query text to a query term map.