Re: Query on SoftUpdateDocument API
Adrien Grand <[email protected]> Fri, 21 Feb 2025 22:47:37 +0100
| Newsgroups | gmane.comp.jakarta.lucene.user |
|---|---|
| Message-ID | <CAPsWd+PU+HM_Zzh9faa_YTz=H_TcioDt0=qbsKioiypTWaRX_g@mail.gmail.com> |
Hi Abhishek, Actually softUpdate is about doing an update where the deletion is performed via a soft delete rather than a hard delete. To perform doc-value updates, you need to use the updateNumericDocValue or updateBinaryDocValue APIs. Note that it doesn't actually update in-place, it needs to rewrite doc values for the updated field for the entire segment containing the updated doc (similarly to deletes). It's still often more efficient than a regular update. Le ven. 21 févr. 2025, 20:15, Abhishek Chandran < [email protected]> a écrit : > Hello, Lucene community! > > I am reaching out to you to seek help with one of the updated APIs. > > I have a use case where I need to update the Lucene document's docValue > fields in place, i.e., without creating a new document with every update. I > believe softUpdateDocument should help me achieve this, but I'm a bit > confused about the documentation, > > These are the questions I have: > > 1. Does the softUpdateDocument API create a new document with every new > update? If so, how is it different from the updateDocument API? Is this the > correct API for my use case, where I don't have to increase the segment > size because of a huge influx of docValue updates? > > 2. The softUpdateDocument takes two arguments: a Document and varargs of > type Field. If my Document consists of different types of fields (string, > docValues, text), should I send in the same document with all the fields or > create a new document with only the supporting docValue fields? > > I hope to hear from you soon. > > Thank you so much! > > -Abhishek >