0

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?

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
devnull
  • 11
  • 2
  • 6
    Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange network, you've granted a non-revocable right, under the [CC BY-SA 4.0 license](//creativecommons.org/licenses/by-sa/4.0/), for Stack Exchange to distribute that content (i.e. regardless of your future choices). By Stack Exchange policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: [How does deleting work?](//meta.stackexchange.com/q/5221) – Dharman Jan 23 '20 at 23:15

1 Answers1

1

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
  • 7,762
  • 2
  • 41
  • 37
  • 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 – devnull Jul 27 '10 at 15:59
  • 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 Jul 27 '10 at 23:43
  • 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 – devnull Jul 28 '10 at 06:48
  • 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 Jul 28 '10 at 09:47