Development
5 min readNobody likes a search that returns 10,000 results for "blue shirt." Your customers want the blue shirt, the one that fits their style, budget, and needs. That's where search relevancy becomes critical for eCommerce success.
Broadleaf's search functionality has been set up to work well out of the box, but sometimes you need more control over the search results. You may want to push discounted items higher up during Black Friday, or boost products with better ratings. Relevancy Rules give you that control without touching code.
Behind the scenes, Broadleaf uses Apache Solr to manage search functionality. However, you don't need to be a Solr expert in order to tailor search results to your needs. Our Search Services create a clean API layer that handles the bulk of search complexity for you.
The two most important key concepts are the FieldDefinition and FieldVariant.
Once a user searches for an item, Broadleaf runs multiple query types simultaneously: word matches, phrase matches, and exact matches. Most of the time, this gives you solid results without any tweaking.
But what if you want more control over the ordering of results? That's where Relevancy Rules enable boosting of searches to show preferred items.
Relevancy Rules work by boosting results which match a defined set of criteria. If matched, the items will show up before similar results that do not match the rules. There are four different approaches in that Relevancy Rules can be utilized:
To make sure that results don’t get over-skewed, such as the case of Relative Rules, a minimum score is applied to ensure there is a minimum limit.
The Broadleaf Admin console will allow you to handle rule creation without requiring a change to any code. Under Search settings in the navigation panel, you'll be able to configure and create Relevancy Rules.
You can also group rules together and assign different groups to different parts of your site. For example, your admin search needs might use different relevancy logic than your customer-facing storefront.
Note that these tools aren’t just for developers. Marketing teams can create a rule to promote specific brands during campaigns, and Product managers can boost items with better margins during slow periods. No code deployments needed.
Search relevancy works best when customers don't notice it. They find what they want quickly and move on. When it's broken, the frustration is obvious. Customers bounce after digging through pages of irrelevant results.
Relevancy Rules help align search results with business goals. You can promote seasonal items, highlight profitable products, or showcase highly-rated merchandise without complex development work.
The beauty is in the flexibility. You can start simple with a few basic rules, then add sophistication as you learn what works for your catalog and customers.
Broadleaf's search foundation is solid, but Relevancy Rules give you the fine-tuning control that separates good eCommerce search from great search. Whether you're optimizing for conversions, customer satisfaction, or business priorities, having this level of control over search results is invaluable.
The best part? Your business users can manage most of this themselves, freeing up development time for other priorities.