Skip to Content
Aug 21, 2018 at 10:35 PM

Index a collection object as value provider in solr


Requirement is to display 'compatible products' along with product search result.

Compatible product is also a product(different product extended model) where 1 or more products could be added to a product as compatible products. I've to display this in the category page. For e.g. In Telco, I've to display compatible list of phones for a plan.

Created a multi-value solr property and added a custom value provider to index this attribute.

In the valueprovider, I could fetch the list of compatible product model and returns the product code as fieldValues.

While populating the search result in the category page, I'm querying the DB for these compatible product and populate required attributes like url, name and code. I feel this approach is bad, since I've to query DB for these items every time, whereas right approach would be using solr results.

If anyone had achieved this functionality through any better approach, please provide your ideas. Or similar kind of requirement.

anything like listeners or postprocessor or beforehandlers to handle this functionality?