OK, tôi đã không thể tìm ra điều này cho đến nay. Hy vọng ai đó có thể cung cấp một số cái nhìn sâu sắc.Cách tìm kiếm các đối tượng lồng nhau với tìm kiếm đàn hồi
Đưa ra các tài liệu bên dưới, làm cách nào tôi tìm kiếm tất cả các tài liệu có video có "kiểm tra" trong tiêu đề video? Tôi đang sử dụng API HTTP. (Về cơ bản, làm thế nào để bạn tìm kiếm đối tượng lồng nhau với tìm kiếm đàn hồi? Tôi biết đó có phải là tài liệu trên mạng, nhưng tôi đã không thực sự có thể tìm thấy bất kỳ.)
[{
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"
}
}]
Bạn không nhất thiết phải lồng vide. Xem http://www.elasticsearch.org/blog/2010/02/12/yourdatayoursearch.html và câu trả lời của tôi bên dưới. – dira
Đây là liên kết được cập nhật: http://www.elasticsearch.org/blog/your-data-your-search/ – swatkins
Tôi thấy bài đăng trên blog này thực sự hữu ích: http://www.elasticsearch.org/blog/managing -relations-inside-elasticsearch/ – Quin