lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Indexed numeric fields return indexed() == false
Date Fri, 26 Apr 2013 12:43:31 GMT
Unfortunately you can't read an existing document, modify it and add it to
an existing or new index.  You'll have to create a new Document, populate
it with fields of the relevant types, using values from the source index if
they are stored, then add the new Document to the new index.

If there are fields in the source index that are not stored, you've got a
problem.  Ah - I see that you say they are all stored so that's OK.


--
Ian.



On Fri, Apr 26, 2013 at 12:09 PM, Neil Ireson <n.ireson@dcs.shef.ac.uk>wrote:

> Hi all,
>
> I am copying documents from a source index to another (and adding more
> fields), all the fields are indexed and stored.
>
> I'm basically doing...
>
> for (int docNum = 0; docNum < maxDoc; docNum++)
> {
>   Document doc = indexReader.document(docNum);
>   doc.add(new Field1...);
>   doc.add(new Field2...);
>
>   indexWriter.addDocument(doc);
> }
>
> However I have a number of DoubleField types and these fields are copied
> but not re-indexed and fieldType().indexed() == false, despite being
> indexed in the source index.
>
> Everything works fine for StringField types.
>
> Is this a bug or am I doing something wrong?
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.**apache.org<java-user-unsubscribe@lucene.apache.org>
> For additional commands, e-mail: java-user-help@lucene.apache.**org<java-user-help@lucene.apache.org>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message