- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的目标是使用multiple search在一个ES请求中发送3个独立的查询
我正在使用NEST客户端使用以下功能将查询发送到Elastic search
IElasticClient _elasticClient.LowLevel.Msearch<string>(query).Body;
curl -XPOST localhost:9200/_msearch -d '
{"index" : "search_results"}
{ "size": 0, "query": { "bool": { "must": [ { "term": { "partnersites": "16" } }, { "match_phrase_prefix": { "name": "manchester" } } ] } }, "aggs": { "event_results": { "terms": { "field": "name.keyword", "size": 1 }, "aggs": { "top_tag_hits": { "top_hits": { "size": 1, "_source": [ "name", "groupedName", "groupedDisplayName", "groupedUrl", "eventCode", "venueName", "venueTown", "venueId", "venueUrl", "media", "categories.name" ] } } } } } }
{"index" : "search_results2"}
{ "size": 0, "query": { "bool": { "must": [ { "term": { "partnersites": "16" } }, { "match_phrase_prefix": { "venueName": "Manchester" } } ] } }, "aggs": { "venue_results": { "terms": { "field": "name.keyword", "size": 1 }, "aggs": { "top_tag_hits": { "top_hits": { "size": 1, "_source": [ "name", "groupedName", "groupedDisplayName", "groupedUrl", "eventCode", "venueName", "venueTown", "venueId", "venueUrl", "media", "categories.name" ] } } } } } }
{"index" : "search_results3"}
{ "size": 0, "query": { "bool": { "must": [ { "term": { "partnersites": "16" } }, { "match_phrase_prefix": { "venueTown": "manchester" } } ] } }, "aggs": { "location_results": { "terms": { "field": "name.keyword", "size": 1 }, "aggs": { "top_tag_hits": { "top_hits": { "size": 1, "_source": [ "name", "groupedName", "groupedDisplayName", "groupedUrl", "eventCode", "venueName", "venueTown", "venueId", "venueUrl", "media", "categories.name" ] } } } } } }
'
最佳答案
问题在于缩进。试试这个:
public static string qu = @"{""index"" : ""search_results""}
{ ""size"": 0, ""query"": { ""bool"": { ""must"": [ { ""term"": { ""partnersites"": ""16"" } }, { ""match_phrase_prefix"": { ""name"": ""manchester"" } } ] } }, ""aggs"": { ""event_results"": { ""terms"": { ""field"": ""name.keyword"", ""size"": 1 }, ""aggs"": { ""top_tag_hits"": { ""top_hits"": { ""size"": 1, ""_source"": [ ""name"", ""groupedName"", ""groupedDisplayName"", ""groupedUrl"", ""eventCode"", ""venueName"", ""venueTown"", ""venueId"", ""venueUrl"", ""media"", ""categories.name"" ] } } } } } }
{""index"" : ""search_results2""}
{ ""size"": 0, ""query"": { ""bool"": { ""must"": [ { ""term"": { ""partnersites"": ""16"" } }, { ""match_phrase_prefix"": { ""venueName"": ""Manchester"" } } ] } }, ""aggs"": { ""venue_results"": { ""terms"": { ""field"": ""name.keyword"", ""size"": 1 }, ""aggs"": { ""top_tag_hits"": { ""top_hits"": { ""size"": 1, ""_source"": [ ""name"", ""groupedName"", ""groupedDisplayName"", ""groupedUrl"", ""eventCode"", ""venueName"", ""venueTown"", ""venueId"", ""venueUrl"", ""media"", ""categories.name"" ] } } } } } }
{""index"" : ""search_results3""}
{ ""size"": 0, ""query"": { ""bool"": { ""must"": [ { ""term"": { ""partnersites"": ""16"" } }, { ""match_phrase_prefix"": { ""venueTown"": ""manchester"" } } ] } }, ""aggs"": { ""location_results"": { ""terms"": { ""field"": ""name.keyword"", ""size"": 1 }, ""aggs"": { ""top_tag_hits"": { ""top_hits"": { ""size"": 1, ""_source"": [ ""name"", ""groupedName"", ""groupedDisplayName"", ""groupedUrl"", ""eventCode"", ""venueName"", ""venueTown"", ""venueId"", ""venueUrl"", ""media"", ""categories.name"" ] } } } } } }
";
var result = _elasticClient.LowLevel.Msearch<string>(qu).Body; // Query ES for results.
关于json - ElasticSearch Nest Msearch fn不会带来所有结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40617178/
这个问题在这里已经有了答案: JavaScript idiom: !something && function() (5 个答案) 关闭 9 年前。 我多次看到 fn && fn() 是对 if (
我在一个对象中有两个函数 var obj = {}; obj.fn1 = function(){ console.log('obj.fn1'); return this; }; obj.fn2 = f
我正在尝试使用以下 cloudformation 堆栈,但我一直失败并出现以下错误: 模板错误:每个 Fn::Split 对象都需要两个参数,(1) 字符串分隔符和 (2) 要拆分的字符串或返回要拆分
请在这方面提供一些帮助,我将不胜感激。不确定这意味着什么,因为这是我第一次使用 node 和 express。我将 express 设置为与 Node 一起使用,并尝试遵循网站 Express.js
我有一段代码接受 fn 作为参数并将其存储在 object 属性中。 var obj = {}; function anotherFn(fn){ obj["name"] = fn.apply(f
谁能解释一下? IE8 ( function(){ window.foo = function foo(){}; console.log( window.foo === foo );
我查看了lazy-seq的来源,我发现了这个: Clojure 1.4.0 user=> (source lazy-seq) (defmacro lazy-seq "Takes a body of
我知道 $fn.insertAfter() 用于在作为参数提供的元素之后插入元素。 $fn.after() 与它有何不同? 最佳答案 $.fn.after()help在您调用的目标元素之后插入一个元素
所以我的网络模板中有这个 CloudFormation 资源: Resources: ... PubSubnetAz2: Type: AWS::EC2::Subnet
有some conventions说到using brackets in JavaScript ,但是当使用方括号调用时,它们实际上会得到不同的对待吗? fn () 是否与 fn() 有任何不同,人类
我正在尝试将 clojurescript 编译为 Nodejs,我只是想使用 println 函数: (println "hello world") 但是,它给了我一个错误 No *print-fn
我在看别人代码的时候,有看到代码是这样写的 function(){ fn&&fn() } 大概意思是这么个意思,但是这我感觉这样写好像没意义,有带佬能指点一下吗
是否可以使用折叠表达式实现以下目的? template auto foo(Args... args) { //calling foo(x0, x1, x2) should be exactly
fn func(_: i64) -> bool { true } fn func_of_func(callback: &fn(i64) -> bool, arg: i64) -> bool {
我一直在到处寻找对此的解释。我知道,在 Javascript 中,您可以使用方括号表示法获取/设置对象的属性,但是当您在括号中使用“+”时会发生什么,如下所示: obj['e'+type+fn] =
我正在尝试根据Fn::GetAZs'集合动态生成资源: AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::LanguageExtensio
新的 React Hooks 功能很酷,但有时会让我感到困惑。特别是,我将此代码包装在 useEffect Hook 中: const compA = ({ num }) => { const [
我看到这个快捷方式作为代码 Kata 的答案给出,但我很难理解下面的示例在做什么。 function func(fn) { return fn.bind.apply(fn, arguments);
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: C++ namespace question 我见过几个没有命名空间的例子。这样做有什么好处?
所以在一个项目中,我找到了可以简化为的代码: export abstract class Logger { private static log(level: LogLevels, ...ar
我是一名优秀的程序员,十分优秀!