【发布时间】:2018-01-12 04:39:42
【问题描述】:
我创建了这个函数:
public static ISearchResponse<Immo> searchImmoByCustomerField(Nest.ElasticClient esClient, string esIndex, string esIndex2, int from, int take, string qField, string nmqField, string qTerm, string nmqTerm)
{
var result = esClient.Search<Immo>(s => s
.AllIndices()
.Query(q => q
.Indices(i => i
.Indices(new[] { esIndex, esIndex2 })
.Query(iq => iq.Term(qField, qTerm))
.NoMatchQuery(iq => iq.Term(nmqField, nmqTerm))
)
)
);
return result;
}
在 2 个索引中查找搜索词的函数。 Visual Studio 向我显示消息:
“已弃用。您可以在查询中指定 _index 以针对特定索引”
但是我该怎么做呢?
【问题讨论】:
-
您需要
NoMatchQuery吗?因为弃用来自 Elasticsearch 5 本身,所以弃用 index query
标签: c# elasticsearch nest