From the user perspective I wouldn't delete it, because it could be that down-voting by mistake or spam or something and up-voting can resurrect it. It could be also wise to keep the docs to see which content (from which users?) are down voted to get spam accounts?

From the dev perspective you should benchmark it, if really necessary. (I guess updating is a more expensive because I think it is delete+completely-new-add)

Regards,
Peter.

My documents have a "down_vote" field. Every time a user votes down a document, I 
increment the "down_vote" field in my database and also re-index the document to Solr to 
reflect the new down_vote value.
During searches, I want to restrict the results to only documents with, say 
fewer than 3 down_vote. 2 ways to implement that:
1) When a user down vote a document, check to see if total down votes have 
reached 3. If it has, delete document from Solr index.
2) When a user down vote a document, update the document in Solr index to reflect the new 
down_vote value even if total down votes might have been more than 3. During query, add a 
"fq" to restrict results to documents with fewer than 3 down votes.
Which approach is better? Is it faster to delete a document from index or to 
update the document to reflect the new down_vote value?
Thanks.Andy



Reply via email to