Likes and favourite item search and storage


I'm looking for the best practise for recording 'likes' of an item.

If I have a document

'name' : 'Dave',
'age' : 40,
'album' : 'foo'

If people decide to 'like' 'Daves' album 'foo'. Where is the best place to
store these 'likes'? in the document?

'name' : 'Dave',
'age' : 40,
'album' : 'foo',
'likes' : {

Or store the likes in a different type? Because When I return results for
albums, Dave's album should rank higher because that album has more likes.
But also I want to show how many likes the album has. But with people
liking and un-liking albums, I want to avoid conflicts with updates.

So what is the best approach? Should I put everything into a queue? How
will I query and arrange by number of likes if the documents are separated?


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

1 Like