Tamam, şimdiye kadar bunu çözemedim. Birinin umuduyla biraz içgörü sunabilir.Yuvalanmış nesneleri elastik arama ile arama
Aşağıdaki belgeler dikkate alındığında, video başlığında "test" olan bir videoyla tüm belgeleri nasıl arayabilirim? HTTP API kullanıyorum. (Temel olarak, elastik arama ile iç içe nesneleri aramak nasıl? Oraya belgeler olmalı biliyorum ama gerçekten herhangi bulmak mümkün olmamıştır.)
[{
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"
}
}]
Vide'yi yerleştirmeniz gerekmiyor. Http://www.elasticsearch.org/blog/2010/02/12/yourdatayoursearch.html adresine ve aşağıdaki cevabıma bakın. – dira
Güncellenmiş link: http://www.elasticsearch.org/blog/your-data-your-search/ – swatkins
Bu blog yazısını gerçekten faydalı buldum: http://www.elasticsearch.org/blog/managing -relations-inside-elasticsearch/ – Quin