【问题标题】:Sitecore Lucene indexSitecore Lucene 索引
【发布时间】:2013-11-26 03:50:19
【问题描述】:

我们最近部署到客户端环境,但没有看到新闻项目 - 这些是使用基于模板 id 的 Lucene 搜索找到的

我只能认为 Lucene 没有找到它们。我已经重建了搜索索引,我们肯定在搜索正确的模板。

我认为新闻没有包含在 Lucene 找到的项目中。我在 Sitecore.SharedSource.Search.config 中看不到任何阻止返回结果的内容。搜索索引适用于其他项目(例如,我们将其用于菜单)。

有什么想法吗?我应该补充一点,我们已将我们的 sitecore 站点添加到外部开发的现有项目中,并且可能存在我们目前不知道它在做什么的库代码/配置!

这是来自 Sitecore.SharedSource.Search.config 的索引配置

<index id="advancedmaster" type="Sitecore.Search.Index, Sitecore.Kernel">
            <param desc="name">$(id)</param>
            <param desc="folder">advanced_master</param>
            <Analyzer ref="search/analyzer" />
            <locations hint="list:AddCrawler">
              <master type="Sitecore.SharedSource.Search.Crawlers.AdvancedDatabaseCrawler,Sitecore.SharedSource.Search">
                <Database>master</Database>
                <Root>/sitecore/content</Root>
                <IndexAllFields>true</IndexAllFields>

                <include hint="list:ExcludeField">
                  <!-- __revision field -->
                  <fieldId>{8CDC337E-A112-42FB-BBB4-4143751E123F}</fieldId>
                  <!-- __context menu field -->
                  <fieldId>{D3AE7222-425D-4B77-95D8-EE33AC2B6730}</fieldId>
                  <!-- __security field -->
                  <fieldId>{DEC8D2D5-E3CF-48B6-A653-8E69E2716641}</fieldId>
                  <!-- __renderings field -->
                  <fieldId>{F1A1FE9E-A60C-4DDB-A3A0-BB5B29FE732E}</fieldId>
                </include>

                <fieldCrawlers hint="raw:AddFieldCrawlers">
                  <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.LookupFieldCrawler,Sitecore.SharedSource.Search" fieldType="Droplink" />
                  <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.Search" fieldType="Datetime" />
                  <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.Search" fieldType="Date" />
                  <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.NumberFieldCrawler,Sitecore.SharedSource.Search" fieldType="Number" />
                </fieldCrawlers>

                <!-- If a field type is not defined, defaults of storageType="NO", indexType="UN_TOKENIZED" vectorType="NO" boost="1f" are applied-->
                <fieldTypes hint="raw:AddFieldTypes">
                  <!-- Text fields need to be tokenized -->
                  <fieldType name="single-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="multi-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="word document" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="html" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="rich text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="memo" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <!-- Multilist based fields need to be tokenized to support search of multiple values -->
                  <fieldType name="multilist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="treelist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="treelistex" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <fieldType name="checklist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                  <!-- Legacy tree list field from ver. 5.3 -->
                  <fieldType name="tree list" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                </fieldTypes>
              </master>
            </locations>
          </index>

【问题讨论】:

  • 您使用的是哪个版本的 Sitecore?看看你的索引中有什么,如果 7 使用Luke else Index Viewer。请注意6.6 uses a different version of lucene。否则检查配置是否正确,并且您没有在某处引用 master。
  • 您是否尝试过搜索TemplateId 的任何其他项目?它有效吗?向我们展示您用于搜索的代码
  • 您是否还检查了日志文件以查看索引过程是否成功完成?另外,我遇​​到了一个问题,即我的索引将被删除,然后页面将被加载并缓存而没有结果,然后索引会重建。因为空页面被缓存,所以结果不会显示。如果您已配置缓存,可能也值得清除缓存。
  • 请提供您的索引配置文件内容。
  • 我们使用的是 Sitecore 6.5。搜索在本地和我们的开发服务器上运行良好,但我们在客户端的开发服务器上看到了问题。不幸的是,我们无法在那里安装 IndexViewer,并且日志中没有任何内容。

标签: sitecore


【解决方案1】:

问题是我们仍然为这些新闻项目启用了工作流(我们希望将其关闭以进行测试).. 并且父项目处于需要审查的状态,因此它没有出现在搜索结果中。

感谢您的建议 - 所有这些都增加了知识的海洋!

【讨论】:

    【解决方案2】:

    您是否不小心排除了模板而不是包含模板?

    <include hint="list:ExcludeTemplate"> 
        <template>ID HERE</template>  
    </include>
    

    <include hint="list:IncludeTemplate">
       <template>ID HERE</template>  
    </include>
    

    您也可能错误地列出了您的模板。每个都需要有不同的名称。

    <include hint="list:IncludeTemplate">
       <news>NEWS ID HERE</news>
       <event>EVENT ID HERE</event>
    </include>
    

    【讨论】:

    • 不,没有明确包含或排除的模板
    • 我的建议是明确包含模板。抱歉,我无法提供更多帮助。祝你好运!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-01
    相关资源
    最近更新 更多