thank your for grate explanation. As you said in 3 point (Index using 2 word "shingles"), i made a query in shingle field but return an empty buckets. the response looks like this
{
"took" : 18,
"timed_out" : false,
"_shards" : {
"total" : 64,
"successful" : 64,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 847,
"max_score" : 0.0,
"hits" : [ ]
},
"aggregations" : {
"trending" : {
"doc_count" : 847,
"keywords" : {
"doc_count" : 847,
"bg_count" : 301038,
"buckets" : [ ]
}
}
}
}
If i change the query field from shingle to normal text analyzer filed it return the result as below.
{
"took" : 40,
"timed_out" : false,
"_shards" : {
"total" : 64,
"successful" : 64,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 847,
"max_score" : 0.0,
"hits" : [ ]
},
"aggregations" : {
"trending" : {
"doc_count" : 847,
"keywords" : {
"doc_count" : 847,
"bg_count" : 301038,
"buckets" : [
{
"key" : "watling",
"doc_count" : 9,
"score" : 2.1136922940749283,
"bg_count" : 16
},
{
"key" : "kshiti",
"doc_count" : 4,
"score" : 1.6737509565673134,
"bg_count" : 4
},
{
"key" : "sumatran",
"doc_count" : 4,
"score" : 1.3380562552184319,
"bg_count" : 5
},
{
"key" : "kakade",
"doc_count" : 4,
"score" : 1.3380562552184319,
"bg_count" : 5
},
{
"key" : "bj",
"doc_count" : 5,
"score" : 1.3054042394227003,
"bg_count" : 8
}
]
}
}
}
}