Additional fields in facet


(yark) #1

Can i obtain additional field in facet section? (mote than only field and its count). I need to obtain category name and its url.

My goal is to get trend of some field (6-10 mos popular) within day, month, year. There 100-1000 entries per day, so i can't obtain addiyional information from search results so my query smth like this:

{
"size":0,
"query":{
"range":{
"created":{
"from":1306784328,"to":1306784328 // timestamp
}
}
},
"facets":{
"trends":{
"terms":{
"field":["title"],
"size":6
}
}
}
}

I tried to specify "field":["title", "slug"] but it returns summary count and only one field value (the last one in array, "slug")

may be i'm doing it wrong?

PS my index smt like this:

doc1:{
title: "Item Title",
slug: "item-title",
created: 1306784328
}
doc2:{
title: "Item Title2",
slug: "item-title2",
created: 1306784328
}
etc.


(system) #2