【问题标题】:How to build lucene indexes on CD server如何在 CD 服务器上建立 lucene 索引
【发布时间】:2014-12-10 10:35:44
【问题描述】:

我有两台服务器,一台用于内容管理网站,一台用于内容交付网站。两台服务器都有以下配置。

CM 服务器: 1) IIS 在哪个网站上运行。 2) Sitecore 文件夹和文件。 3)Core、Master和Web数据库 4) 网站代码文件/文件夹。

CD 服务器 1) IIS 在哪个网站上运行。 2) 没有 Sitecore 文件夹和文件。 3) 核心和通用网络数据库。 4) 网站代码文件/文件夹。

注意:Web 数据库在这两个网站中是通用的。

我可以浏览这两个网站的网页 但来自 CM 网站的 Sitecore 仅作为 CD 站点没有 sitecore 文件。

我的一些页面正在从 Lucene 索引中获取内容。

现在我从控制面板的 Sitecore(CM 网站)构建 lucene 索引,索引已成功构建在 CM 服务器的数据文件夹中,并且没有在 CD 网站的数据文件夹中创建索引。

我第一次尝试在 CD 服务器上复制索引,但是当我发布更改时,它只更新了 CM 服务器数据文件夹上的索引,而不是 CD 服务器数据文件夹上的索引。

我想在发布项目时在 CM 和 CD 服务器上的 Data 文件夹内创建索引。

索引的配置是

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <configuration type="Sitecore.ContentSearch.LuceneProvider.LuceneSearchConfiguration, Sitecore.ContentSearch.LuceneProvider">
        <indexes hint="list:AddIndex">
          <index id="sitecore_web_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
            <param desc="name">$(id)</param>
            <param desc="folder">$(id)</param>
            <!-- This initializes index property store. Id has to be set to the index id -->
            <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" />
            <strategies hint="list:AddStrategy">
              <!-- NOTE: order of these is controls the execution order -->
              <strategy ref="contentSearch/indexUpdateStrategies/onPublishEndAsync" />
            </strategies>
            <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
              <policies hint="list:AddCommitPolicy">
                <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
              </policies>
            </commitPolicyExecutor>
            <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>web</Database>
                <Root>/sitecore</Root>
              </crawler>
            </locations>
          </index>
        </indexes>
      </configuration>
    </contentSearch>
  </sitecore>
</configuration>

发布策略是“onPublishEndAsync” 请提出建议。

【问题讨论】:

    标签: lucene sitecore lucene.net sitecore7


    【解决方案1】:

    如果您的 cd 服务器有另一个数据库,那么您应该将这部分服务器的配置更改为:

    <locations hint="list:AddCrawler">
      <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>NAMEOF-CD1-DATABASE</Database>
        <Root>/sitecore</Root>
      </crawler>
    </locations>
    

    编辑:我看到您有跨服务器的“网络”数据库,因此上述情况不适用于您的情况。

    还要检查您是否启用了可扩展性设置(在 Scaling Guide 的 4.1 中说明)。如果未启用,则在 CM 服务器上触发的事件将不会在(远程)CD 服务器上触发。 http://sdn.sitecore.net/Reference/Sitecore%207/Scaling%20Guide.aspx

    再次编辑:我发现这篇文章解释了不同的更新策略。你应该看看 RemoteRebuildStrategy。此策略允许 CD 服务器侦听重建事件。 http://www.sitecore.net/Learn/Blogs/Technical-Blogs/John-West-Sitecore-Blog/Posts/2013/04/Sitecore-7-Index-Update-Strategies.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-08
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-06
      相关资源
      最近更新 更多