【发布时间】:2015-06-16 04:06:28
【问题描述】:
我正在使用 NEST 在我的弹性搜索索引中搜索 Event 对象。在基本层面上,Event 看起来像这样:
public class Event
{
public int Id {get; set;}
[ElasticProperty(Index = FieldIndexOption.NotAnalyzed)]
public string EventType {get; set;}
}
我的搜索看起来像这样:
SearchDescriptor<Event> search = new SearchDescriptor<Event>()
.From(0)
.Take(10000)
.QueryRaw(@"{""match_all"": {} }")
.FacetTerm("my_facet", f => f.OnField("eventType"));
var esResults = esClient.Search<Event>(search);
目前,我在 ES 中的所有文档都有一个 eventType 或 Test type,但方面正在返回 Test 和 type 的结果,而不是一起返回它们。
我的理解是 Index = FieldIndexOption.NotAnalyzed 应该可以缓解这个问题,但我仍然看到它。为什么会这样?
【问题讨论】:
标签: c# elasticsearch nest