好的,至今我還沒有弄清楚。希望有人能提供一些見解。如何用彈性搜索搜索嵌套對象
鑑於以下文檔,我將如何搜索視頻標題中包含「測試」視頻的所有文檔?我正在使用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