【问题标题】:After upgrading sitecore from 6.6 to 7.0, getting error Field not found: 'Store.YES'将 sitecore 从 6.6 升级到 7.0 后,出现错误 Field not found: 'Store.YES'
【发布时间】:2015-04-15 23:01:25
【问题描述】:

我将 sitecore 从 6.6 升级到 7.0。在此过程中,我将解决方案中的所有项目升级到 .net framework 4.5,并升级了所有 nuget 包。

升级后,我能够构建我的解决方案并浏览网站,但在遇到与 sitecore 搜索相关的功能时出现运行时错误。

所以我在以下情况下遇到错误: 1. 在 sitecore 控制台中执行任何搜索时。 2. 从网站执行任何搜索时。

Project 具有自定义搜索功能。

出现以下错误:

Server Error in '/' Application.

Field not found: 'Store.YES'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more  information about the error and where it originated in the code. 

Exception Details: System.MissingFieldException: Field not found: 'Store.YES'.

Source Error: 


Line 36:                 return new List<Item>();
Line 37: 
Line 38:             var searchIndex = SearchManager.GetIndex(_options.Database.Name.ToLower());
Line 39:             using (var context = searchIndex.CreateSearchContext())
Line 40:             {

Source File: c:\Gexa\Source\Customer Care\External Web\KStreet\DEV - SmallComm\GexaNes.Services\SearchService\SiteSearcher.cs    Line: 38 

Stack Trace: 


[MissingFieldException: Field not found: 'Store.YES'.]
   scSearchContrib.Crawler.SearchField.SetStorageType(String storageType) +0
   scSearchContrib.Crawler.Crawlers.AdvancedDatabaseCrawler.AddFieldTypes(XmlNode configNode) +470

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
   Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +571
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +523
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +198
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +298
   Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +91
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +81
   Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +706
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +416
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +198
   Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +706
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +416
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +198
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +298
   Sitecore.Configuration.Factory.CreateObject(String configPath, Boolean assert) +38
   Sitecore.Search.SearchManager.get_SearchConfiguration() +24
   Sitecore.Search.SearchManager.GetIndex(String id) +41
   GexaNes.Services.SearchService.SiteSearcher.Search(String searchTerm, Int32& resultCount, Int32 start, Int32 end) in c:\Gexa\Source\Customer Care\External Web\KStreet\DEV - SmallComm\GexaNes.Services\SearchService\SiteSearcher.cs:38
   GexaNes.Web.Layout.Sublayouts.Pages.Search.DoSearch(Int32& totalResults) in c:\Gexa\Source\Customer Care\External Web\KStreet\DEV - SmallComm\GexaNes.Web\Layout\Sublayouts\Pages\Search.ascx.cs:138
   GexaNes.Web.Layout.Sublayouts.Pages.Search.Page_Load(Object sender, EventArgs e) in c:\Gexa\Source\Customer Care\External Web\KStreet\DEV - SmallComm\GexaNes.Web\Layout\Sublayouts\Pages\Search.ascx.cs:83
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +92
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

+772

以下是与搜索相关的自定义配置:

<configuration xmlns:x="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <databases>
            <database id="web" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">
                <Engines.HistoryEngine.Storage>
                    <obj type="Sitecore.Data.$(database).$(database)HistoryStorage, Sitecore.Kernel">
                        <param connectionStringName="$(id)" />
                        <EntryLifeTime>30.00:00:00</EntryLifeTime>
                    </obj>
                </Engines.HistoryEngine.Storage>
                <Engines.HistoryEngine.SaveDotNetCallStack>false</Engines.HistoryEngine.SaveDotNetCallStack>
            </database>
        </databases>
        <search>
            <configuration>
                <indexes>
                    <index id="web" type="Sitecore.Search.Index, Sitecore.Kernel">
                        <param desc="name">$(id)</param>
                        <param desc="folder">$(id)</param>
                        <Analyzer ref="search/analyzer" />

                        <locations hint="list:AddCrawler">
                             The crawler configuration is shared and moved outside 
                            <web ref="search/crawlers/default" param1="web" />
                        </locations>
                    </index>
                    <index id="master" type="Sitecore.Search.Index, Sitecore.Kernel">
                        <param desc="name">$(id)</param>
                        <param desc="folder">$(id)</param>
                        <Analyzer ref="search/analyzer" />

                        <locations hint="list:AddCrawler">
                             The crawler configuration is shared and moved outside 
                            <master ref="search/crawlers/default" param1="master" />
                        </locations>
                    </index>
                </indexes>
            </configuration>


            <crawlers>
                <default type="GexaNes.Web.Utilities.IndexCrawler,GexaNes.Web">
                    <Database>$(1)</Database>
                    <Root>/sitecore/content</Root>
                    <IndexAllFields>true</IndexAllFields>

                     INCLUDE TEMPLATE FILTER
                             if this filter used, only items based on these templates specified here will be indexed
                             make sure to add templates GUIDs here with unique xml element <name /> 
                    <include hint="list:IncludeTemplate">
                      <contactUsPage>{41893BA4-A5BC-4B14-BEFB-D65257B813ED}</contactUsPage>
                      <contentPage>{191B0A26-A1E7-4DA4-A7E9-47FC8485161A}</contentPage>
                      <landingPage>{0B5298F2-607D-4754-AB6F-CC39559B36F2}</landingPage>
                      <promoPage>{2BDB4D8C-1313-4457-AD89-CDD117494DA7}</promoPage>
                      <requestAQuotePage>{3FC81F3D-B6B4-43C8-BE6C-808F154F4382}</requestAQuotePage>
                      <vanityPage>{04FBFF6D-2EBF-437F-AE17-CC71BECEE3FC}</vanityPage>
                    </include>

                     EXCLUDE TEMPLATE FILTER
                             use this filter to ignore items created from specific templates
                             make sure to add templates GUIDs here with unique xml element <name /> 
                     <include hint="list:ExcludeTemplate">
                                <uniqueTemplateToken1>{GUID}</uniqueTemplateToken1>
                             </include>

                     INCLUDE FIELD FILTER
                             if this filter used, only these fields will be added to the index.
                             make sure to add field GUIDs here with unique xml element <name /> 
                     <include hint="list:IncludeField">
                                 <uniqueFieldToken1>{GUID}</uniqueFieldToken1>
                             </include>

                     EXCLUDE FIELD FILTER
                             use this filter to ignore specific fields from being indexed
                             make sure to add field GUIDs here with unique xml element <name /> 
                     <include hint="list:ExcludeField">
                                <__revision>{8CDC337E-A112-42FB-BBB4-4143751E123F}</__revision>
                                <__contextmenu>{D3AE7222-425D-4B77-95D8-EE33AC2B6730}</__contextmenu>
                                <__security>{DEC8D2D5-E3CF-48B6-A653-8E69E2716641}</__security>
                                <__renderings>{F1A1FE9E-A60C-4DDB-A3A0-BB5B29FE732E}</__renderings>
                            </include> 

                     FIELD CRAWLERS
                             define logic of how each field is crawled per field type 
                    <fieldCrawlers hint="raw:AddFieldCrawlers">
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.LookupFieldCrawler,scSearchContrib.Crawler" fieldType="Droplink" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.LookupFieldCrawler,scSearchContrib.Crawler" fieldType="Droptree" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.DateFieldCrawler,scSearchContrib.Crawler" fieldType="Datetime" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.DateFieldCrawler,scSearchContrib.Crawler" fieldType="Date" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.NumberFieldCrawler,scSearchContrib.Crawler" fieldType="Number" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.MultilistFieldCrawler,scSearchContrib.Crawler" fieldType="Multilist" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.MultilistFieldCrawler,scSearchContrib.Crawler" fieldType="Treelist" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.MultilistFieldCrawler,scSearchContrib.Crawler" fieldType="TreelistEx" />
                        <fieldCrawler type="scSearchContrib.Crawler.FieldCrawlers.MultilistFieldCrawler,scSearchContrib.Crawler" fieldType="Checklist" />
                    </fieldCrawlers>

                     DYNAMIC FIELDS
                             a set of computed fields to be added to your index
                             this can significally slow down the indexing process 
                    <dynamicFields hint="raw:AddDynamicFields">
                        <dynamicField type="scSearchContrib.Crawler.DynamicFields.AllTemplatesField,scSearchContrib.Crawler" name="_alltemplates" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
                    </dynamicFields>

                     FIELD TYPE INDEXING SETTINGS
                             defines how each field is stored/unstored, tokenized/untokenized, boosted, etc. per field type
                             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" />
                    </fieldTypes>
                </default>
            </crawlers>
        </search>
    </sitecore>
</configuration>

非常感谢您对此事的任何帮助。

谢谢

【问题讨论】:

    标签: search lucene sitecore lucene.net


    【解决方案1】:

    我可以看到您在配置中引用了scSearchContrib,这表明使用了Advanced Database Crawler 模块。这与 Sitecore 7 中的新搜索基础架构不兼容。需要重构使用它的索引/搜索代码。

    如果您不熟悉 Sitecore 7 Search,以下是帮助您入门的文档:

    Sitecore Search and Indexing Guide

    这是一个 Github 示例,有人演示了转换:

    Example of how I converted Advanced Database Crawler functionality to Sitecore 7.

    【讨论】:

    • 感谢马丁的意见。我一定会试一试,目前我正在禁用搜索功能并继续升级 Sitecore 8,稍后会考虑重构搜索功能。
    • 太棒了。希望一切顺利。
    • 最后我重写了我的索引并重构了现有的搜索代码以利用 contentSearch 库。非常感谢您的帮助。
    【解决方案2】:

    你也可以看看这个文档

    http://sdn.sitecore.net/upload/sitecore7/70/developer's_guide_to_item_buckets_and%20search_sc7-a4.pdf

    【讨论】:

    • 感谢 Geetika 的帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-20
    • 1970-01-01
    • 1970-01-01
    • 2017-03-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多