栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

使用NEST V5.4重新索引-ElasticSearch

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用NEST V5.4重新索引-ElasticSearch

搜索2天后,我找到了重新索引索引的解决方案。为了解决将来的问题,我将提供解决方案。

Nest版本-5.4

var reindex = client.Reindex<object>(r => r   .BackPressureFactor(10)   // ScrollAll - Scroll all the documents of the index and store it for 1minute    .ScrollAll("1m", 2, s => s       .Search(ss => ss.Index(oldIndexName)    .AllTypes())// there needs to be some degree of parallelism for this to work.MaxDegreeOfParallelism(4))   .CreateIndex(c => c       // New index here       .Index(newIndexName)       .Settings(// settings goes here)       .Mappings(// mappings goes here))   .BulkAll(b => b       // New index here!       .Index(newIndexName)       .Size(100)       .MaxDegreeOfParallelism(2)       .RefreshonCompleted()));

ReIndex方法返回一个冷的 IObservable ,您必须在其上调用 .Subscribe() 以启动所有操作。

因此,您需要将其添加到您的代码中:

var o = new ReindexObserver( onError: (e) => { //do something }, onCompleted: () => { //do something });reindex.Subscribe(o);

进行检查的有用链接是:

文献资料

GitHub上的第2660期

GitHub上的问题2771



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/387430.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号