Re: java.lang.NullPointerExcpetion while indexing on linux

2008-08-21 Thread Aditi Goyal
On Wed, Aug 20, 2008 at 6:12 PM, Michael McCandless <[EMAIL PROTECTED] > wrote: > > Aditi Goyal wrote: > > Thanks Mike. I found the problem. >> The problem was that I was not converting the value of the fields to utf-8 >> and hence while adding it to doc it was getting stored as None. >> So, when

Re: java.lang.NullPointerExcpetion while indexing on linux

2008-08-20 Thread Michael McCandless
Aditi Goyal wrote: Thanks Mike. I found the problem. The problem was that I was not converting the value of the fields to utf-8 and hence while adding it to doc it was getting stored as None. So, when I did doc.get('fieldA') , instead of giving the blank or any other string, it was giving

Re: java.lang.NullPointerExcpetion while indexing on linux

2008-08-20 Thread Aditi Goyal
Thanks Mike. I found the problem. The problem was that I was not converting the value of the fields to utf-8 and hence while adding it to doc it was getting stored as None. So, when I did doc.get('fieldA') , instead of giving the blank or any other string, it was giving out None. To overcome this,

Re: java.lang.NullPointerExcpetion while indexing on linux

2008-08-19 Thread Michael McCandless
On quick look that code looks fine, though removeField is an expensive operation and unnecessary for this. We really need the full traceback of the exception. Mike Aditi Goyal wrote: Thanks Michael and Ian for your valuable response. I am attaching a small default code. Please have a look

Re: java.lang.NullPointerExcpetion while indexing on linux

2008-08-19 Thread Aditi Goyal
Thanks Michael and Ian for your valuable response. I am attaching a small default code. Please have a look and tell me where am I going wrong. import lucene from lucene import Document, Field, initVM, CLASSPATH doc = Document() fieldA = Field('fieldA', "", Field.Store.YES, Field.Index.UN_TOKENIZE

Re: java.lang.NullPointerExcpetion while indexing on linux

2008-08-19 Thread Michael McCandless
Ian Lea wrote: I don't think you need to remove the field and then add it again, but I've no idea if that is relevant to your problem or not. That's right: just leave the Field there and change its value (assuming the doc you are changing to still uses that field). A full stack trace wou

Re: java.lang.NullPointerExcpetion while indexing on linux

2008-08-19 Thread Ian Lea
Hi I don't think you need to remove the field and then add it again, but I've no idea if that is relevant to your problem or not. A full stack trace would be more help, and maybe an upgrade to 2.3.2, and maybe a snippet of your code, and what is JCC? -- Ian. On Tue, Aug 19, 2008 at 10:09 AM,

java.lang.NullPointerExcpetion while indexing on linux

2008-08-19 Thread Aditi Goyal
Hi All, I am using IndexWriter for adding the documents. I am re-using the document as well as the fields for improving index speed as per the link http://wiki.apache.org/lucene-java/ImproveIndexingSpeed. So, for each doc, i am first removing field using doc.removeField() and then field.setValue(