好的,至今我还没有弄清楚。希望有人能提供一些见解。如何用弹性搜索搜索嵌套对象
鉴于以下文档,我将如何搜索视频标题中包含“测试”视频的所有文档?我正在使用HTTP API。 (基本上,你怎么搜索嵌套对象有弹性的搜索?我知道必须有文档在那里,但我还没有真正找到任何。)
[{
id:4635,
description:"This is a test description",
author:"John",
author_id:51421,
video: {
title:"This is a test title for a video",
description:"This is my video description",
url:"/url_of_video"
}
},
{
id:4636,
description:"This is a test description 2",
author:"John",
author_id:51421,
video: {
title:"This is an example title for a video",
description:"This is my video description2",
url:"/url_of_video2"
}
},
{
id:4637,
description:"This is a test description3",
author:"John",
author_id:51421,
video: {
title:"This is a test title for a video3",
description:"This is my video description3",
url:"/url_of_video3"
}
}]
您不一定需要嵌套视频。请参阅http://www.elasticsearch.org/blog/2010/02/12/yourdatayoursearch.html以及我的答案。 – dira
这里是更新后的链接:http://www.elasticsearch.org/blog/your-data-your-search/ – swatkins
我发现这篇博文的确很有用:http://www.elasticsearch.org/blog/managing -relations-inside-elasticsearch/ – Quin