首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Lucene索引创建不起作用

Lucene索引创建不起作用
EN

Stack Overflow用户
提问于 2012-09-12 18:25:31
回答 1查看 804关注 0票数 0

我正试图在一个内容项目模板上创建一个基于Lucene的索引,其中一个内容项目模板上的内容项目模板是通过App.Config创建的。记住,这里列出的‘主’SC DB,而不是物理SQL。这是我的代码:

代码语言:javascript
复制
    <configuration xmlns:x="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <databases>
      <database id="master" 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="master" type="Sitecore.Search.Index, Sitecore.Kernel">
            <param desc="name">$(id)</param>
            <param desc="folder">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/Data</Root>
                <IndexAllFields>false</IndexAllFields>
                <include hint="list:IncludeTemplate">
                  <template1>{EF11A8D0-D373-4A4B-90BA-16984D277612}</template1>
                </include>
                <fieldCrawlers hint="raw:AddFieldCrawlers">
                  <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.LookupFieldCrawler,Sitecore.SharedSource.Search" fieldType="Single-Line Text" />
                  <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.Search" fieldType="Multilist" />
                </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>
        </indexes>
      </configuration>
    </search>
  </sitecore>
</configuration>

之后,当我运行解决方案时,我会通过“索引查看器”查看我的索引,但是看不到任何东西。我在这里做错了什么?

我添加了以下代码:

代码语言:javascript
复制
  private IDictionary<string, Sitecore.Search.Index> GetSearchIndexes()
    {
        var _configuration = Sitecore.Configuration.Factory.CreateObject("search/configuration", true) as Sitecore.Search.SearchConfiguration;
        return _configuration.Indexes;
    }

但是在_configuration.Indexes的回归中,我得到了:主人,网络,高级。我的索引是不同的,这些是DBs的列表。

EN

回答 1

Stack Overflow用户

发布于 2012-09-12 19:10:17

我猜你指的是web.config而不是app.config

转到Sitecore > Control > Database >重新构建搜索索引,以在文件系统上生成索引。

或者下载这个剧本并运行它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12394202

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档