on 04-05-2017 12:30 AM
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.
Well, solr comes with some limitations and you should be aware of them. Some of them are:
it works only in simple search mode; in advanced search mode flexible search is used, as noted [here|https://help.hybris.com/6.3.0/hcd/09ed7d4c299c404591f4cb705bfc725f.html]
data needs to be synced between the database and index - it is done using a cronjob, which introduces some delay
You should consider all of them before making a decision to use solr.
Cheers,
Marcin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes its calling and the filtering works in simple search mode but not in advance search mode. Also this solution dependent on cron job which is not feasible. So I'm thinking another solution to achieve the same thing.
Here's link to problem description: https://jira.hybris.com/browse/ESINNOS-31
I'm trying to implement same in backoffice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jaimin,
Is your initializer code called?
Cheers,
Marcin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.