简体   繁体   English

当我从 Sitecore 填充 Solr 托管架构时,Managed-schema.xml 文件被覆盖

[英]Managed-schema.xml file is overwritten when I populate Solr Managed Schema from Sitecore

In my solr managed-schema.xml file I added the following:在我的 solr managed-schema.xml 文件中,我添加了以下内容:

<copyField source="computedtitle_t" dest="computedtitlecopy_t" />

When I populate-schema from Sitecore, the managed-schema file is overwritten and so are my changes当我从 Sitecore 填充模式时,托管模式文件被覆盖,我的更改也是如此

Is there a patch file on the Sitecore side where I can add this and to what section? Sitecore 端是否有补丁文件,我可以将其添加到哪个部分?

Yes, Sitecore manages the Solr schema for you through the populate-schema function in the Control Panel.是的,Sitecore 通过控制面板中的填充模式 function 为您管理 Solr 模式。 This is done via the SchemaPopulateHelper .这是通过SchemaPopulateHelper完成的。 You can implement your own class, implementing the ISchemaPopulateHelper interface and register it in the config.您可以实现自己的 class,实现ISchemaPopulateHelper接口并将其注册到配置中。

A while back, I wrote a generic implementation of this where you can put your entire managed schema as part of the Sitecore config instead.不久前,我编写了一个通用实现,您可以将整个托管模式作为 Sitecore 配置的一部分。 This also allows leveraging from the Sitecore config file patch feature, so that your schema changes can go along with other Sitecore configs if needed.这也允许利用 Sitecore 配置文件补丁功能,以便您的架构更改可以 go 以及其他 Sitecore 配置(如果需要)。

You can read more about it here: https://mikael.com/2020/10/dealing-with-solr-managed-schema-through-sitecore-config-files/您可以在此处阅读更多相关信息: https://mikael.com/2020/10/dealing-with-solr-managed-schema-through-sitecore-config-files/

Here are some more generic info about how Sitecore works with Solr and managed schema: https://mikael.com/2018/01/working-with-content-search-and-solr-in-sitecore-9/以下是有关 Sitecore 如何与 Solr 和托管架构一起使用的一些更通用的信息: https://mikael.com/2018/01/working-with-content-search-and-solr-in-sitecore-9/

You can use the code here as a starting point: https://github.com/mikaelnet/sitecore-solr-config您可以使用此处的代码作为起点: https://github.com/mikaelnet/sitecore-solr-config

Please note that there was a small interface change in Sitecore 9.3 (I think), so the sample code may need some changes for it to work.请注意,Sitecore 9.3 中有一个小的界面更改(我认为),因此示例代码可能需要一些更改才能正常工作。 Also, make sure you start with a managed schema that is equal to the one that's provided with the Sitecore version you're using.此外,请确保您从托管架构开始,该架构与您使用的 Sitecore 版本提供的架构相同。 There may be a few changes in the default schema between the versions.版本之间的默认架构可能会有一些变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM