使用C#在其中具有空格和特殊字符的Elastic Search-Search字符串

使用C#在其中具有空格和特殊字符的Elastic Search-Search字符串,第1张

使用C#在其中具有空格和特殊字符的Elastic Search-Search字符串

请参考下面的代码,我认为这将满足您的要求。在这里,我已经使用动态模板创建并映射了索引,然后执行了XDCR。现在将不分析所有字符串字段

 IIndicesOperationResponse result = null;         if (!objElasticClient.IndexExists(elastic_indexname).Exists)         {  result = objElasticClient.CreateIndex(elastic_indexname, c => c.AddMapping<dynamic>(m => m.Type("_default_").DynamicTemplates(t => t        .Add(f => f.Name("string_fields").Match("*").MatchMappingType("string").Mapping(ma => ma .String(s => s.Index(FieldIndexOption.NotAnalyzed)))))));     }

谢谢

穆克什(Mukesh Raghuwanshi)



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/4973592.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-14
下一篇2022-11-13

发表评论

登录后才能评论

评论列表(0条)

    保存