如何为布尔值添加Hybris Solr By [英] How to add Hybris Solr By for Boolean value

查看:98
本文介绍了如何为布尔值添加Hybris Solr By的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为 isNewProduct 的Solr索引属性(布尔型),并且我想为此属性创建一个新的Solr By选项. (具有isNewProduct == true的产品必须首先出现).

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 ?

推荐答案

所有您需要做的就是在Impex下运行(用您的实际值更改),然后就完成了.

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 

请注意,当我们添加新的SolrSort时,Hybris在内部将其引用添加到sorts字段中的SolrIndexedType,以便您可以在店面中看到该选项.但是,如果缺少SolrSort值,则始终可以使用后台/Impex对其进行验证和纠正.

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.

类似下面的内容

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

这篇关于如何为布尔值添加Hybris Solr By的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆