Skip to main content

Module search_query

Module search_query 

Source
Expand description

Shared search-query expression helpers.

The helpers in this module build small SeaQuery expressions for common search behavior used by Aster repositories: escaped LIKE patterns, case-insensitive substring checks, SQLite FTS phrase queries, and MySQL boolean-mode phrase queries. They do not depend on product entities and leave database-specific query composition to the caller.

Functionsยง

escape_like_query
Escapes the escape character itself and the wildcard characters for SQL LIKE queries.
lower_like_condition
Builds a case-insensitive LIKE '%query%' condition for a column.
mysql_boolean_mode_query
Builds a quoted MySQL boolean-mode phrase query when the input is safe.
sqlite_fts_match_condition
Builds a SQLite FTS subquery condition matching row ids from an FTS table.
sqlite_match_query
Builds a quoted SQLite FTS phrase query when the input is long enough.