tags:

views:

46

answers:

1

I'm using Lucene/solr for searching and navigation in file upload application i need to update the indexed value 'downloaded' for each document for each download.

the same case happed in digg.com , they have how many "diggs" for each link while u searching

does i have to delete/insert new document for each download. or there something which is better?

+1  A: 

As per the FAQ on the Solr Wiki, you cannot partially update a document:

In Lucene to update a document the operation is really a delete followed by an add. You will need to add the complete document as there is no such "update only a field" semantics in Lucene.

You have to add the whole document if you wish to update a field.

Jason Weathered
i know that , there are no update implementation..it's not my question . my question is how digg is implement it , and what's the best practice to implement the same idea digg
Sorry, I misunderstood what you were asking. If Digg are storing the vote counts in Lucene at all, I imagine it would not be realtime. I would think a better way would be to store the votes in your primary store and cache it in Memcache for the view.
Jason Weathered
Ok, but each time someone vote for a url it's must be indexed in the lucene engine, so it become available for the search , and u can order your search results using the vote field
If it's available as a search field (for ordering or otherwise), yes, the document must be indexed. Unless indexing is rather fast, this index is probably updated on a delay. (i.e. scan for posts every minute which have changed and reindex them).
Jason Weathered
thanks, that's make sense ..