OpenSearch 3.x vector search – embeddings via Ollama, k-NN, hybrid search
OpenSearch 3.x adds neural/vector search capabilities that were previously only available in specialised vector databases. Combined with Ollama running locally for embedding generation, you can add semantic product search to Magento 2 without external API dependencies. I show the complete implementation: generating embeddings, storing k-NN vectors, hybrid search combining text and semantic scoring.
- Published in Magento / Adobe Commerce
Interpreter pattern – own discount rule grammar, parser, expression tree
Interpreter is the GoF pattern for implementing a mini-language. Instead of hardcoding discount rules, you define a grammar and an interpreter that evaluates expressions at runtime. This makes complex pricing rules configurable without code deployments. I build a complete discount rule language in PHP: grammar definition, recursive descent parser, AST, and evaluation.
- Published in PHP, Wzorce projektowe
AI-assisted SQL optimisation – LLM + EXPLAIN + Blackfire, 5x speedup
SQL optimisation has always required human expertise, but the workflow has changed. I now use an LLM as a pair programmer when reading EXPLAIN output – it translates the cryptic rows into plain English and suggests indexes. Blackfire shows me where the time goes. Together they cut a query from 4.2 seconds to 0.8 seconds in an afternoon. I show the complete workflow with real examples.
- Published in Magento / Adobe Commerce, PHP
Hyvä advanced patterns – Alpine.js Store, events, lazy loading, reusable components
Once you know the Hyvä basics – PHTML templates, Alpine.js x-data, Tailwind classes – the next step is advanced patterns that make complex features maintainable. Alpine.js Store for shared state, custom events for cross-component communication, lazy loading for heavy widgets, and reusable component patterns are what separate a well-architected Hyvä theme from a pile of inline scripts.
- Published in Magento / Adobe Commerce
