【问题标题】:How to add Hybris Solr By for Boolean value如何为布尔值添加 Hybris Solr By
【发布时间】:2019-12-20 03:10:29
【问题描述】:

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

关于如何实现这一点的任何提示?

【问题讨论】:

  • 你见过Hybris Solr Sort吗?您应该能够为 isNewProduct 遵循相同的计划。
  • 我关注了这个helphybris.com/2018/03/…,但没有成功
  • 您尝试遵循的链接用于自定义比较器,但在您的情况下,您不需要编写任何自定义比较器。 @MatsLindh 指出了正确的链接。对于布尔值或字符串值,您可以在不更改任何代码的情况下执行此操作。关注how to add or update Sort by Options

标签: solr hybris impex


【解决方案1】:

你所要做的就是在 Impex 下运行(用你的实际值改变它)然后你就完成了。

    $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 在内部将其对 SolrIndexedType 的引用添加到 sorts 字段中,以便您可以在店面中看到该选项。但是,如果您的 SolrSort 值丢失,您可以随时使用后台/Impex 进行验证和更正。

类似下面的东西

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

【讨论】:

猜你喜欢
  • 2015-02-15
  • 1970-01-01
  • 2011-12-10
  • 2012-06-03
  • 2018-07-17
  • 2021-04-08
  • 2012-09-01
  • 2011-03-16
  • 2017-09-05
相关资源
最近更新 更多