Skip to content

Prioritize Main Products Over Accessories in Search Results

I have a Magento 2 store selling phones and phone accessories. When customers search for “iPhone”, the search results randomly show a mix of iPhones and accessories.
I want to prioritize the actual iPhone products (in category ID: 123xx) to appear first in search results, before accessories.
Is this possible through Magento’s default configuration? If not, what’s the recommended way to implement this?

Environment:

  • Magento version: CE 2.4.3
  • Search engine: elasticsearch 7