Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hybris如何为SOLR中的变量编制索引_Solr_Hybris_Solrj - Fatal编程技术网

Hybris如何为SOLR中的变量编制索引

Hybris如何为SOLR中的变量编制索引,solr,hybris,solrj,Solr,Hybris,Solrj,我从Electronics accelerator开始,它只对SOLR中的基础产品进行索引。我有多个从GenericVariantProduct扩展而来的变体产品,我需要在Grid/PLP中显示它们。如何更改SOLR indexer查询以便也为变体编制索引?这是用于electronicsProductType的查询: 为了索引数据库中所有可用的产品,可以使用以下查询: SELECT {PK} FROM {Product} 您可以使用以下Impex来实现您的目标: $solrIndexedTyp

我从Electronics accelerator开始,它只对SOLR中的基础产品进行索引。我有多个从GenericVariantProduct扩展而来的变体产品,我需要在Grid/PLP中显示它们。如何更改SOLR indexer查询以便也为变体编制索引?

这是用于electronicsProductType的查询:

为了索引数据库中所有可用的产品,可以使用以下查询:

SELECT {PK} FROM {Product}
您可以使用以下Impex来实现您的目标:

$solrIndexedType=electronicsProductType
$searchIndexNamePrefix=electronics

UPDATE SolrIndexerQuery; solrIndexedType(identifier)[unique = true]; identifier[unique = true]        ;query
                       ; $solrIndexedType                          ; $searchIndexNamePrefix-fullQuery ; "SELECT {PK} FROM {Product}"

调整它以更符合您的需要

实际查询是什么?在哪里可以找到它?太好了!谢谢顺便说一句,查看OOTB查询让我产生了疑问,他们为什么执行第二个WHERE子句?我指的是或{varianttype}不是在{varianttype}中的{SELECT{PK},其中{code}='ElectronicsColorVariantProduct'}和{code}不是在{GenericVariantProduct}中的{SELECT{code}中,仅仅从{Product}中选择{PK SELECT}是不够的,因为{varianttype}为空,所以只能选择基本产品?实际上,我更喜欢第一条,它包含在第二条中
$solrIndexedType=electronicsProductType
$searchIndexNamePrefix=electronics

UPDATE SolrIndexerQuery; solrIndexedType(identifier)[unique = true]; identifier[unique = true]        ;query
                       ; $solrIndexedType                          ; $searchIndexNamePrefix-fullQuery ; "SELECT {PK} FROM {Product}"