Skip to Content
0
Former Member
Apr 04, 2017 at 11:30 PM

Solr search indexed property

477 Views

Hi, I'm trying to link all the products with all the associated workflow actions by creating solr indexed property called "workflowActionPk" and created a provider which returns all the field values when running the full index (product is part of three workflow actions):

 product pk:1978440_green
 de.hybris.platform.solrfacetsearch.provider.FieldValue@3070fa22[field=workflowActionPk_long_mv,value=8796126282841]
 de.hybris.platform.solrfacetsearch.provider.FieldValue@3de83717[field=workflowActionPk_long_mv,value=8796126315609]
 de.hybris.platform.solrfacetsearch.provider.FieldValue@20663e50[field=workflowActionPk_long_mv,value=8796126348377]  

Now I want to search based on this property to filter the products which are part of particular workflow. In order to achieve this, I'm implementing the AdvancedSearchInitializer and overriding the following method and added the following condition:

 public void addSearchDataConditions(final AdvancedSearchData searchData, final Optional<NavigationNode> navigationNode){
                    final FieldType workflowActions = new FieldType();
                     workflowActions.setDisabled(Boolean.FALSE);
                     workflowActions.setSelected(Boolean.TRUE);
                     workflowActions.setName("workflowActionPk");

                    searchData.addFilterQueryRawCondition(workflowActions, ValueComparisonOperator.CONTAINS, ((WorkflowActionTemplateModel) data).getPk().getLong());

the problem is it's not filtering the products. Any help would be greatly appreciated.