lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: IndexWriter.mergeDocument(Term term, Document doc)
Date Sun, 04 Jul 2010 17:58:09 GMT
This idea has been discussed a few times on the list... eg try
googling on "incremental document field update".

It's tricky; Lucene doesn't make it easy to update just a portion of a
document's postings information.  The implementation will be very
different from updateDocument...

Mike

On Tue, Jun 29, 2010 at 11:58 AM, Pablo Mendes <pablomendes@gmail.com> wrote:
> Hi all,
> I'm looking for a functionality similar to IndexWriter.updateDocument()
>
> *IndexWriter.**updateDocument<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/index/IndexWriter.html#updateDocument%28org.apache.lucene.index.Term,%20org.apache.lucene.document.Document%29>
> *(Term<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/index/Term.html>
> term,
> Document<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/document/Document.html>
>  doc)
>          Updates a document by first deleting the document(s) containing
> term and then adding the new document.
>
> *IndexWriter.**updateDocument<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/index/IndexWriter.html#updateDocument%28org.apache.lucene.index.Term,%20org.apache.lucene.document.Document,%20org.apache.lucene.analysis.Analyzer%29>
> *(Term<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/index/Term.html>
> term,
> Document<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/document/Document.html>
> doc,
> Analyzer<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/analysis/Analyzer.html>
>  analyzer)
>          Updates a document by first deleting the document(s) containing
> term and then adding the new document.
>
> But instead of deleting the document containing term and then adding the new
> document,
> I'd like to merge the information from the new document with the document
> containing the term .
>
> *IndexWriter.merge**Document*(Term<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/index/Term.html>
> term,
> Document<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/document/Document.html>
>  doc)
>          Updates a document by merging the information in the document
> containing term and the new document.
>
> *IndexWriter.merge**Document*(Term<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/index/Term.html>
> term,
> Document<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/document/Document.html>
>  doc, Analyzer<http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/analysis/Analyzer.html>
>  analyzer)
>          Updates a document by merging the information in the document
> containing term and the new document.
>
> I couldn't find anything like that in 3.0.2 [1], so I assume I'll have to
> implement it myself.
> Is the implementation of IndexWriter.updateDocument itself a good starting
> point?
>
> Does anybody have suggestions on how to go about it? Or is it there in some
> other shape or form?
> Or is it absolutely discouraged?
>
> Thanks,
> Pablo
>
> [1]
> http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/document/class-use/Document.html
>

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


Mime
View raw message