2014-02-28 115 views
3

有没有人有一个想法如何添加额外的属性在我的Facet导航显示在产品列表页面上?到目前为止,我只能选择价格范围,但我想添加品牌和其他过滤器,你知道如何通过hMC维护它吗?我认为这是与Solr的配置,但我相当新的hybris ...Hybris Facet导航

+0

阅读论坛和wiki涵盖的内容 – 2014-02-28 10:47:44

+1

HMC> System> Facet Config。在samplesata扩展中查看示例impexes,我认为yaccelerator中也可能存在impex。 –

+0

使用solr.impex文件创建新的构面属性。看看服装或电子商店slor.impex文件也是如何创建的。有时您还需要通过hmc更新构面索引。 –

回答

0
 
There are two ways to do this 
1.Impex: Go to solr.impex file and add the facet(=true) property to SolrIndexedProperty type header 
Ex: INSERT_UPDATE SolrIndexedProperty;solrIndexedType(identifier)[unique=true];name[unique=true];type(code);sortableType(code);currency[default=false];localized[default=false];multiValue[default=false];facet[default=false];facetType(code);facetSort(code);priority;visible;fieldValueProvider;customFacetSortProvider;rangeSets(name);$classAttributeAssignment 
;electronicsProductType;Megapixel, 63 ;double;; ; ; ;true;MultiSelectOr;Custom;1000;true;commerceClassificationPropertyValueProvider;numericFacetSortProviderDesc;MegaPixelRange;57:::Megapixel, 63:::: 


2.hmc: hmc --> System --> Facet Search --> SolrItemType --> select solritemtype --> add solrindexproperties --> select facet checkbox to true 
3

最好的办法是看看什么是提供开箱即用,在例如电子商店,打开文件/electronicsstore/resources/electronicsstore/import/sampledata/stores/electronics/solr.impex

里面你会发现方面的定义,例如这是一个Megapixles方面定义:

INSERT_UPDATE SolrIndexedProperty;solrIndexedType(identifier) unique=true];name[unique=true];type(code);sortableType(code);currency[default=false];localized[default=false];multiValue[default=false];facet[default=false];facetType(code);facetSort(code);priority;visible;fieldValueProvider;customFacetSortProvider;rangeSets(name);$classAttributeAssignment 
;electronicsProductType;Megapixel, 63   ;double;; ; ; ;true;MultiSelectOr;Custom;1000;true;commerceClassificationPropertyValueProvider;numericFacetSortProviderDesc;MegaPixelRange;57:::Megapixel, 63:::: 

您需要记住的是,对于其他文字/原子的任何定制类型,您需要创建自己的提供程序。对于每个基本的Literal/Atomic类型(String,double,integer,boolean),commerceClassificationPropertyValueProvider就足够了。

0

添加更多的产品属性,如品牌,名称,any_other_attribute,你应该去:

HMC>系统>刻面搜索>索引类型

。搜索与空白字段。

现在选择<Index TYPE> like ** product。现在您可以在表格中看到所有产品属性。他们周围有一些复选框。

这些是产品内部属性的搜索设置。

0

可惜你不能只是简单的添加新的solrIndexedPropertysolrIndexedType通过HMC并希望它会工作,它不会工作,因为你必须保持一些其他点:

  1. 如果你的新属性是一个复杂的对象,例如(品牌,价格,联合,...),您必须创建一个价值提供商将该对象转换为简单的原始数据(字符串,int,double,...)并发送它可以被索引,例如,Brand to Brand.name和Price to Price.formattedValue ...
  2. 然后,您必须通过FacetPopulator将新的solrIndexedProperty值展示给正面。