Skip to content

E-commerce 0.1.10: Shop search takes your words literally

E-commerce 0.1.10 fixes the shop search. A visitor’s search now matches what they typed, and a category page with no matching products says the filters are the reason.

Search matches what was typed

The characters %, _ and \ in a search acted as wildcards. Searching 100% matched every product containing “100”, and the SKU AB_100 also matched ABX100. They now match literally, in product, category and cart searches. Search terms are cut to 100 characters, and a term with a hidden null character no longer causes a database error. The search box is open to visitors who are not signed in, so the length cap also keeps long crafted searches from loading the database.

Empty category pages

When a search or a price or vendor filter matched nothing, a category page still said No products in this category, even though it had products. It now says No products match your filters and offers a Clear filters button, like the main catalog page.

The product and category lists in the admin also keep their row selection in the browser now, and the checkboxes on the product, category and shipping forms use the core checkbox component.

Full release notes: E-commerce 0.1.10

0.1.10 · 12 July 2026

Fixed

  • Search terms are escaped before hitting ILIKE. User input flowed into the %term% pattern raw, so %/_/\ acted as wildcards on a route open to unauthenticated visitors: searching 100% matched every product containing “100”, an SKU search for AB_100 also matched ABX100, and a term ending in \ silently corrupted the pattern into requiring a literal %. Terms are now length-capped (100 chars), NUL-stripped (a crafted %00 raised Postgrex.Error), and LIKE-escaped in one choke point (search_like_pattern/1) shared by the product, category, and admin-cart search filters. The cap also closes a cheap unauthenticated seq-scan amplifier (unbounded multi-KB patterns against six ILIKE evaluations per row, two of them jsonb_each_text expansions).
  • Category pages now show a filters-aware zero-result state. With an active search (or price/vendor filter) matching nothing, the category page claimed “No products in this category — check back soon” even though the category has products; it now says the filters matched nothing and offers a clear-filters affordance, matching the main catalog page. Both the guest and authenticated layouts share one category_empty_state component now.
  • Documented (code comment) the cross-release ordering limitation of merge_missing_builtin_filters/1’s below-minimum positioning scheme: it holds within one merge pass; a hypothetical second sidebar-leading built-in added in a future release should renormalize positions on save instead of extending the scheme.

E-commerce 0.1.10. Install or update: {:phoenix_kit_ecommerce, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.