0

I am adding user details to solr . My fields are :

<doc>
<str name="fullname">myname</str>
<str name="key">12345</str>
<str name="username">myusername</str>
</doc>

Now i want to update the value of field fullname.. I am using key field as uniquekey..

How is it possible to update fullname field without username field?

Someone please help me...

Micku
  • 550
  • 4
  • 9
  • 23
  • possible duplicate of [Update specific field on SOLR index](http://stackoverflow.com/questions/2032813/update-specific-field-on-solr-index) – Mauricio Scheffer Feb 22 '12 at 13:47

1 Answers1

2

Unfortunately that's not possible, there isn't an update feature in Solr like with databases. You have to re-submit the entire document, Solr will look at the uniqueKey, will delete the existing document with the same key and will add to the index the new document you submitted. If you don't include the username in your document you won't have that field anymore.

There were some attempts to make this possible in Solr in the past: have a look at SOLR-139 and SOLR-828. The problem is that Solr knows the original content of stored fields and could reindex them, but it doesn't know about non stored fields. There would be a solution only for stored fields but not yet a generic solution, so both those issues are still unresolved.

javanna
  • 59,145
  • 14
  • 144
  • 125
  • 1
    @Micku You're welcome, unfortunately there isn't any other method for now. I updated my answer adding some more details. – javanna Feb 22 '12 at 12:17