私は私のインデックスに以下の文書を持っています。
elasticsearchでデータを集計した後の一意のキー
{
"key" : 192, "Count" : 5,
"key" : 576, "Count" : 3
}
Count 5 for the key 192 implies number of distinct valueIds for the "Ref"= 192,
Count 3 for the key 576 implies number of distinct valueIds for the "Ref" =576
は、いくつかのいずれかが私を助けてくださいすることができ、以下のように、それは結果を返すように弾性検索でQUERTY(aggreagtions)を構築する方法
{"id":"1","Ref":192,"valueId":596,"locationId":45}
{"id":"21","Ref":192,"valueId":596,"locationId":323}
{"id":"31","Ref":192,"valueId":5596,"locationId":5435}
{"id":"41","Ref":192,"valueId":5596,"locationId":535}
{"id":"51","Ref":192,"valueId":5996,"locationId":78}
{"id":"61","Ref":192,"valueId":5996,"locationId":6565}
{"id":"71","Ref":192,"valueId":5196,"locationId":868}
{"id":"81","Ref":192,"valueId":5296,"locationId":68687}
{"id":"91","Ref":192,"valueId":5296,"locationId":6836}
{"id":"101","Ref":192,"valueId":5296,"locationId":96}
{"id":"111","Ref":192,"valueId":5396,"locationId":56}
{"id":"121","Ref":576,"valueId":5396,"locationId":5}
{"id":"131","Ref":576,"valueId":5496,"locationId":8}
{"id":"141","Ref":576,"valueId":5496,"locationId":5356}
{"id":"151","Ref":576,"valueId":5496,"locationId":896}
{"id":"261","Ref":576,"valueId":5896,"locationId":99}
{"id":"271","Ref":576,"valueId":5896,"locationId":8589}
{"id":"671","Ref":576,"valueId":5896,"locationId":999}
{"id":"431","Ref":576,"valueId":5896,"locationId":3565868}
{"id":"241","Ref":576,"valueId":5896,"locationId":9998}
..?
私は集約を介してのみ必要です。
おかげ