The output s like below one :
curl -X GET "localhost:9200/myindex/_search?pretty" -H 'Content-Type: application/json' -d'
{ "query": {
"match_all": {}
},
"size": 0,
"aggs": {
"keywords": {
"significant_text": {
"field": "userId",
"filter_duplicate_text": true
}
}
}
}
' -u elastic:elastic
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 10000,
"relation" : "gte"
},
"max_score" : null,
"hits" : [ ]
},
"aggregations" : {
"keywords" : {
"doc_count" : 67007,
"bg_count" : 70659,
"buckets" : [
{
"key" : "3a7135074ee9715b8ec07bfda0a75336",
"doc_count" : 28531,
"score" : 0.02306479074069242,
"bg_count" : 28540
},
{
"key" : "99c9a97ce78b4fd1a124a173222a013a",
"doc_count" : 2617,
"score" : 0.0020500645248022376,
"bg_count" : 2622
},
{
"key" : "7a919773e80c43a9b499b1947caa163e",
"doc_count" : 2532,
"score" : 0.0019496069985887787,
"bg_count" : 2539
},
{
"key" : "4b1ed7601091487b982c8632ca86481a",
"doc_count" : 1876,
"score" : 0.0015258900958613191,
"bg_count" : 1876
},
{
"key" : "41b3ef01c68c47cea1cbde66cf8aff3a",
"doc_count" : 1418,
"score" : 9.197778131438137E-4,
"bg_count" : 1433
},
{
"key" : "c7589a964b6349078df094a8872d97a3",
"doc_count" : 1061,
"score" : 8.629900808682623E-4,
"bg_count" : 1061
},
{
"key" : "aa426b628ffa4f7fbc66344d03157178",
"doc_count" : 1024,
"score" : 8.328952335618312E-4,
"bg_count" : 1024
},
{
"key" : "ad77884486564074a2d7885b1698b816",
"doc_count" : 928,
"score" : 7.548113054154072E-4,
"bg_count" : 928
},
{
"key" : "7d7cc295fbe64fdabdcddf15df8a28c1",
"doc_count" : 2108,
"score" : 7.519206332956028E-4,
"bg_count" : 2171
},
{
"key" : "acb4314538bb43eca9027e5efa0ad3a5",
"doc_count" : 773,
"score" : 6.287382964289966E-4,
"bg_count" : 773
}
]
}
}
}
This output is not even complete output of myindex. There are suppose to be more records .. I am not getting entire output ...
Also i want only KEY value as output and rest to be ignored.... as i want to store this output in another index.
Thanks
Tushar Nemade