Likes and favourite item search and storage

Hi,

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' : {
'user1',
'user2',
}
}

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?

Thanks.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a5238715-5df0-40a9-b06f-f33f8d22cc92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

1 Like