4

有没有人有一个如何让这个工作的例子?

我有一个自定义索引器,配置ExamineSettings.config如下:

<add name="KeywordsIndexer"
           type="Examine.LuceneEngine.Providers.SimpleDataIndexer, Examine"
           dataService="SearchIndexers.ParagraphKeywordIndexer"
           directoryFactory="Examine.LuceneEngine.Directories.TempEnvDirectoryFactory,Examine"
           indexTypes="KeywordIndexItem"/>

搜索提供

<add name="KeywordsSearcher"
           indexSet="KeywordsIndexSet"
           enableLeadingWildcards="true"
           type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
           analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" />

和一个索引集,在ExamineIndex.config

<IndexSet SetName="KeywordsIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/Keywords/" IndexParentId="1119">
    <IndexUserFields>
      <add Name="ParagraphId" />
      <add Name="ArticleId" />
      <add Name="ChapterId" />
      <add Name="Keywords1" />
      <add Name="Keywords2" />
      <add Name="Keywords3" />
      <add Name="Keywords4" />
      <add Name="Keywords5" />
      <add Name="Keywords6" />
      <add Name="Keywords7" />
      <add Name="Keywords8" />
      <add Name="Keywords9" />
      <add Name="Keywords10" />
    </IndexUserFields>
  </IndexSet>

然后我有一个自定义类,它实现ISimpleDataService查询内容并创建插入到索引中的自定义项。

当通过后端重建索引按钮手动生成索引时,这一切都很好,但我不知道如何让它从主机传播到从机(在这个设置https中目前有 1 个主机,1 个从机://aws.amazon.com/blogs/devops/run-umbraco-cms-with-flexible-load-balancing-on-aws/)。

我相信我有两个问题:

1)当内容发布在主服务器上时,如何让索引自动重建?(理想情况下只有特定父级/特定类型的内容)

2)一旦重建,我怎样才能让索引传播到从机,以便在所有机器上更新新重建的索引?

这些文档都是特定于 Azure 的,因此很难区分 AWS EBS 什么是必要的,什么不是。我已经看到一些关于“它只是有效”的引用,但不幸的是,到目前为止,我的经验绝对不是这种情况!

任何帮助将不胜感激。

4

0 回答 0