【问题标题】:Sitecore Lucene Index not including all fieldsSitecore Lucene 索引不包括所有字段
【发布时间】:2012-05-10 07:38:57
【问题描述】:

我创建了一个使用默认数据库爬虫的新索引。我无法让它索引我指定的 5 个模板上的所有字段。

我正在使用 IndexViewer 模块来检查上述字段。在可用字段中,它列出了我想要索引的所有字段,但仅索引以下字段 - _url、_group、_name 和 _tags。

我还编写了一些代码来测试索引字段,我得到了想要的结果。我只需要我的索引来包含指定模板上的所有字段。下面是我对索引的配置。

<index id="Articles" type="Sitecore.Search.Index, Sitecore.Kernel">
<param des="name">$(id)</param>
<param des="folder">__articles</param> 
<Analyzer ref="search/analyzer"/>            
<locations hint="list:AddCrawler">
    <customindex type="Sitecore.Search.Crawlers.DatabaseCrawler, Sitecore.Kernel">
        <Database>web</Database>
        <Root>/sitecore/content/[websitehome]</Root>
        <Tags>articles</Tags>
        <IndexAllFields>true</IndexAllFields>
        <include hint="list:IncludeTemplate">
            <template1>{C4663677-909E-4C4D-AB3E-78AADBB36CF7}</template1>
            <template2>{444D1797-1EA9-46F2-988D-2211CF926501}</template2>
            <template3>{1A859C38-FFFA-4102-BF7F-9E670495C3AF}</template3>
            <template4>{6EA89465-C6C4-4643-9589-188FBB180883}</template4>
            <template5>{52F0AB89-E9C3-4D10-9242-ACB669841C41}</template5>               
        </include>
    </customindex>              
    </locations>

【问题讨论】:

    标签: lucene indexing sitecore field


    【解决方案1】:

    尝试使用Lukeall 工具观察索引 - IndexViewer 可能不会显示未存储的字段。要使用 Lukeall,只需选择 C:\inetpub\wwwroot\Sitecore\Data\indexes__articles 文件夹,勾选“只读”和“强制解锁”,然后点击确定。

    【讨论】:

      【解决方案2】:

      我想通了。该索引包括字段而不是它们的值。不确定这是否是索引所需的功能,但是当我查询它时,我会得到结果。

      【讨论】:

      • 也许您可以告诉我们您实际做了哪些工作以使其正常工作?我现在也有同样的问题,我所做的一切都没有用。为什么不包含这些值?
      • 执行查询时没有得到任何结果吗?您可以使用 Luke 或 indexviewer for Sitecore 查看索引项目吗?
      • 你看过这份清单了吗?这也帮助我解决了上述问题。 sitecoreblog.alexshyba.com/2011/04/…
      • 我使用的是卢克 - 它仍然没有显示所有索引字段,即使它们在那里。问题最终是我正在执行数字查询,但没有将数字转换为 lucene 的线性字符串表示形式,因此没有返回任何结果。
      • 我认为在 Lucene 的 Sitecore 实现中,您必须指定“存储”这些字段,这样您就会在这些字段中看到值。出于这个原因,Luke 会向您显示字段,但不会显示它们的值。
      【解决方案3】:

      要使 Lucene 存储索引值 - 在字段定义上设置 storageType="YES"

       <fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">
              <fieldNames hint="raw:AddFieldByFieldName">
                <field fieldName="_uniqueid" storageType="YES"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-01-29
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多