2012-04-30 36 views
1

我創建了一個使用默認數據庫搜尋器的新索引。我無法讓它索引我指定的5個模板上的所有字段。Sitecore Lucene索引不包括所有字段

我正在使用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> 

回答

1

嘗試使用觀察指數Lukeall工具 - IndexViewer可能不會顯示保存字段。要使用Lukeall,只需選擇C:\ inetpub \ wwwroot \ Sitecore \ Data \ indexes__articles文件夾,選中「只讀」和「強制解鎖」,然後單擊確定。

0

我想通了。該指數包含的字段不是它們的值。不知道這是否是索引所需的功能,但是當我查詢它時,我會返回結果。

+1

也許你可以告訴我們你實際上做了什麼來讓它工作?我現在有這個相同的問題,我沒有做的是工作。爲什麼不包括這些值? – George

+0

執行查詢時,您沒有收到任何結果嗎?您可以使用Luke或Indexclicker查看Sitecore的索引項目嗎? – Gabbar

+0

你有沒有通過這個清單?這也幫助我解決了上述問題。 http://sitecoreblog.alexshyba.com/2011/04/search-index-troubleshooting.html – Gabbar

1

要使Lucene商店索引值設置爲storageType =「YES」關於字段定義。

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