How to add Hybris Solr By for Boolean value

我的未来我决定 提交于 2019-12-12 20:17:08

问题


I have a Solr indexed property called isNewProduct (boolean) and I want to create a new Solr By option for this attribute. (the products with isNewProduct==true must appear first).

Any hint about how can I achieve this ?


回答1:


All you have to do is run below Impex (change it with your actual values) and you are done.

    $lang=en
    $solrIndexedType=YourProductType


    INSERT_UPDATE SolrSort ; indexedType(identifier)[unique=true] ; code[unique=true] ; name[lang=$lang] ; useBoost
                           ; $solrIndexedType                     ; isNewProduct      ; New Product      ;false 

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

Please note, when we add a new SolrSort, Hybris internally added its reference to SolrIndexedType in sorts field so that you can see that option on the storefront. But if your SolrSort value is missing, you can always verify and correct it using back-office/Impex.

Something like below

INSERT_UPDATE SolrIndexedType ; identifier[unique=true] ; sorts(code)                                    
                              ; $solrIndexedType        ; SolrSortCode1,SolrSortCode2,isNewProduct


来源:https://stackoverflow.com/questions/57479808/how-to-add-hybris-solr-by-for-boolean-value

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