The problem is that unless you *stored* every field in the Solr index, getting the document back will not have all the original information. Getting a Solr document only returns the stored fields.
And updating is really a delete followed by an add. So let's say you have field A that hasn't been stored. Fetching that document from Solr won't contain any values for field A, and indexing it back to Solr will mean that the document is not what you expect. This may be OK in your app, but it's behavior you need to be aware of. Best Erick On Mon, Mar 21, 2011 at 10:20 AM, Marc SCHNEIDER <marc.schneide...@gmail.com> wrote: > Hi Péter, > > I'm not sure to understand your answer. A SolrInputDocument always contains > only stored fields, so I don't see the problem. > I just like to update an existing stored field... > > Thanks, > Marc. > > 2011/3/21 Péter Király <kirun...@gmail.com> > >> Hi Marc, >> >> as far as I know the best way to do it is working from the original >> source, because it is possible, that not all fields are stores, and >> the original content of the not stored fields is not inside the Solr >> document. >> >> Péter >> >> 2011/3/21 Marc SCHNEIDER <marc.schneide...@gmail.com>: >> > Hello, >> > >> > I'd like to know the fastest way (code lines) to update a field of a >> > document. >> > So my idea was: >> > 1) Get a SolrDocument >> > 2) Add all fields of the SolrDocument to a new SolrInputDocument >> > 3) Update the field in SolrInputDocument >> > 4) Add SolrInputDocument to the server and commit it >> > >> > Is there a fastest way to do that? I mean transforming a SolrDocument >> into a >> > SolrInputDocument? >> > >> > Thanks in advance, >> > Regards, >> > Marc. >> > >> >