You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Chris Fraschetti <fr...@gmail.com> on 2004/11/09 22:54:44 UTC

can lucene be backed to have an update field

Is it possible to modify the lucene source to create an
updateDocument(doc#, FIELD, value)  function ? ....

I know there's a lot of work that goes on being the scene when an
.add(doc) is called, but can some of that functionality be adapter to
make the update a reality?

-Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: can lucene be backed to have an update field

Posted by Paul Elschot <pa...@xs4all.nl>.
Chris,

On Tuesday 09 November 2004 22:54, Chris Fraschetti wrote:
> Is it possible to modify the lucene source to create an
> updateDocument(doc#, FIELD, value)  function ? ....

It's possible, but an implementation would not be efficient
when the field is indexed. The current index structure
has no room to spare for insertions, and no provision for
deleted terms.

Some time ago an extra level was added in the index
for skipping ahead more efficiently. Perhaps that could
be combined with a gap for insertions. But when such a gap
would fill up there would again be no choice but to delete and add 
the changed document.
Also adding a document without optimizing is quite efficient
already, so there is probably not much interest in adding
such gaps.

In case the field is stored only and the value would have the
same length as the currently stored value it would be possible
to replace the value efficiently.

The only updates available are on the field norms.
 
Regards,
Paul Elschot


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org