Re: Rewriting an index without losing 'hidden' data

2011-05-17 Thread Samarendra Pratap
Hi, I know it is too late to answer a question (sorry Chris) but I thought it could be useful to share things (even late). I was just going through the mails and I found that we've done it a few months back. *Objective: To add a new field to existing index without re-writing the whole index.* We

Re: Rewriting an index without losing 'hidden' data

2011-04-08 Thread Michael McCandless
Unfortunately, updateDocument replaces the *entire* previous document with the new one. The ability to update a single indexed field (either replace that field entirely, or, change only certain token occurrences within it), while leaving all other indexed fields in the document unaffected, has bee

Re: Rewriting an index without losing 'hidden' data

2011-04-08 Thread Chris Bamford
Thanks Ian, its as I feared! I shall have to reindex (and upgrade!). Cheers, - Chris -Original Message- From: Ian Lea To: java-user@lucene.apache.org Sent: Fri, 8 Apr 2011 16:00 Subject: Re: Rewriting an index without losing 'hidden' data Unfortunately you jus

Re: Rewriting an index without losing 'hidden' data

2011-04-08 Thread Ian Lea
Unfortunately you just can't do this. Might be possible if all fields were stored but evidently they are not in your index. For unstored fields, the Document object will not contain the data that was passed in when the doc was originally added. I believe there might be a way of recreating some o

Rewriting an index without losing 'hidden' data

2011-04-08 Thread Chris Bamford
Hi, I recently discovered that I need to add a single field to every document in an existing (very large) index. Reindexing from scratch is not an option I want to consider right now, so I wrote a utility to add the field by rewriting the index - but this seemed to lose some of the fields (in