首页 > 解决方案 > 站点核心内容搜索中的搜索索引刷新和搜索索引重建有什么区别

问题描述

谁能告诉我两者之间的区别我可以看到执行时间方面的区别,但我想要从功能角度来看的区别。

 void Rebuild();
        void Rebuild(IndexingOptions indexingOptions);
        Task RebuildAsync(IndexingOptions indexingOptions, CancellationToken cancellationToken);
        void Refresh();
        void Refresh(IIndexable indexableStartingPoint, IndexingOptions indexingOptions);
        void Refresh(IIndexable indexableStartingPoint);
        Task RefreshAsync(IIndexable indexableStartingPoint, IndexingOptions indexingOptions, CancellationToken cancellationToken);





 void Update(IEnumerable<IndexableInfo> indexableInfo);
        void Update(IEnumerable<IIndexableUniqueId> indexableUniqueIds);
        void Update(IEnumerable<IIndexableUniqueId> indexableUniqueIds, IndexingOptions indexingOptions);
        void Update(IIndexableUniqueId indexableUniqueId);
        void Update(IIndexableUniqueId indexableUniqueId, IndexingOptions indexingOptions);

标签: indexingsolrsitecoresitecore9

解决方案


重建:如果您进行了任何更改,例如...更改 schema.xml。更改就像您添加了一个字段并更改了一个字段的字段类型。在这种情况下,您需要重建索引以反映更改。

刷新:如果您想添加更多或更新现有索引的数据。你会刷新它。例如:您使用了 Solr 的 DIH 功能并索引了一个数据库。如果数据库的数据被添加或修改值,需要在 Solr 索引中刷新。您将在此处通过调用 Solr 的 Delta 导入来使用刷新。

更新:您可以通过传递文档的唯一 ID 来指定要更新的文档以及要更新的所有字段,以防您需要更新任何特定字段。

注意:我没有使用上面的 api。我建议您阅读 api 文档并阅读有关特定 api 的更多信息。


推荐阅读