我有ES和巢工作和搜索通配符。我想统计我所看到的记录数量和数量是否允许精确匹配,但我想要一个“喜欢”匹配(在sql中 - 作为比喻)。 下面的代码不会返回任何内容。有没有人有任何想法?Elasticsearch NEST和通配符计数
var searchDataCount = client.Count<SearchRow>(s => s.Index("myindex").AllTypes().
Query(q => q.QueryString(qs => qs.OnFields(j => j.searchstring).Query(@searchString))));
var searchDataResults = client.Search<SearchRow>(s =>s.Index("myindex").AllTypes().
From(startcount).Size(recordsize). Query(q => q.
QueryString(qs => qs.OnFields(j => j.searchstring).Query(@searchString))));
是的我明白这是可能的,但client.Count根本不起作用,我也尝试使用Aggregations与ValueCount也失败。我想要的是相当于select中的select(count)(*),其中col就像ES中的'%test%'。我有搜索工作(不计算),但计数部分不起作用。 –
你可以用count查询来做同样的事情 –
这里的代码 - http://nest.azurewebsites.net/nest/core/count.html - 对我不起作用。即使client.count()失败,但client.search的作品。非常令人沮丧的是没有返回错误信息。该对象只是说“不存在”的返回对象。 –