禁止在 Hybris 前端搜索具有特定属性值的产品 [英] Disable search for the products on the Hybris front end having a specific attribute value

查看:19
本文介绍了禁止在 Hybris 前端搜索具有特定属性值的产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个要求,我不想在具有特定属性值的 Hybris 前端搜索产品.即使 Hybris SOLR index 中存在以下产品.

Suppose I have a requirement whereby I don't want to search the products on the Hybris frontend having a specific attribute value. Even if the following products are present in the Hybris SOLR index.

如何解决这个问题?

推荐答案

哪些产品应该被索引是由灵活的搜索查询定义的.

Which products should be indexed are defined by flexible search queries.

您可以通过导航到 System/Facet Search/Indexed Typeshmc/backoffice 中找到它们.选择您的索引类型.在那里您可以找到完整和更新的查询.

You find them in hmc/backoffice by navigating to System/Facet Search/Indexed Types. Select your indexed type. There you find full and update queries.

完整查询由 Full SolR Indexer CronJob 使用,它每晚在默认情况下运行并完全重新创建 SolR 索引.更新查询类似地由 Update SolR Indexer CronJob 使用,它默认每小时运行一次,只更新在其间发生更改的产品.因此,您会在更新查询中找到类似 WHERE {sl:modifiedtime} >= ?lastIndexTime 的内容,而在完整查询中却没有.

The full query is used by a Full SolR Indexer CronJob which runs in the default case every night and recreates the SolR index completely. The update query similarly is used by a Update SolR Indexer CronJob which runs by default every hour and just updates products which have been changed in between. Therefore you find something like WHERE {sl:modifiedtime} >= ?lastIndexTime in the update query, which is missing in the full query.

您可以以任何需要的方式更改查询.例如.假设您的查询是:

You can change the query in every way you need it. E.g. assuming your query is:

SELECT {pk} FROM {Product}

改成

SELECT {pk} FROM {Product} WHERE {myAttribute} LIKE 'index this product'

PS:在关联的 Facet Search 配置(System/Facet Search/Facet Search Config)上找到 Solr Indexer Cronjobs.

PS: Find the Solr Indexer Cronjobs on your associated Facet Search Config (System/Facet Search/Facet Search Config).

PPS:还有一个删除查询,您可以在其中定义应从 SolR 索引中删除的产品.

PPS: There is also a delete query, where you define products which should be removed from SolR index.

这篇关于禁止在 Hybris 前端搜索具有特定属性值的产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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