How to sort with a “nested” filter in Hybris Solr

耗尽温柔 提交于 2019-12-24 03:05:54

问题


Relationed to this post How to add Hybris Solr By for Boolean value

I need to add a kind of "nested filter": when I filter with my boolean atribute isNewProduct , inside this sort , I want to sort by relevance (number indexed property) for example :

I have this products:

Product A : isNewProduct = true , relevance = 100;
Product B : isNewProduct = false , relevance = 50;
Product C : isNewProduct = true , relevance = 300;
Product D : isNewProduct = false , relevance = 40;

When I filter by isNewProduct, the result must be :

Product C > Product A > Product B > Product D.

Is possible to make an ordenation inside another ordenation ?


回答1:


I hope you want the second field as a score. Try like this

INSERT_UPDATE SolrSortField ; sort(indexedType(identifier),code)[unique=true] ; fieldName[unique=true] ; ascending[unique=true]
                                ; $solrIndexedType:isNewProduct                   ; isNewProduct       ; true 
                                ; $solrIndexedType:isNewProduct                   ; score              ; false 


来源:https://stackoverflow.com/questions/57497641/how-to-sort-with-a-nested-filter-in-hybris-solr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!