Hi Gimatha,

Yes. It is possible to use IndexWriter updateDocument() to update document.
But with that method what happens under the hood is it deletes matching
documents and re-index new document. I need to update only a single field.
Re-indexing a new document with updated field + other fields seems to be
big overhead. My question is, why lucene does that and currently is there a
way we can avoid this ?

Thanks,
Chalitha

On Fri, Jul 10, 2015 at 1:46 PM, Gimantha Bandara <giman...@wso2.com> wrote:

> Hi Chalitha,
>
> You can simply use indexWriter.updateDocument to update the existing index
> documents
>
> On Fri, Jul 10, 2015 at 11:38 AM, chalitha udara Perera <
> chalithaud...@gmail.com> wrote:
>
> > Hi All,
> >
> > I have a requirement for updating lucene index (add single field for
> > existing docs and modify value of another field). These documents contain
> > many other fields that do not need any modifications. But as I understand
> > luence provides delete/add mechanism for even single field value
> updates. I
> > would really  appreciate if someone can explain me why lucene use these
> > delete/add for updates as it feels like a real bottleneck.
> >
> > Is there any way to do single fields updates without using delete/add ?
> >
> > Thanks,
> > Chalitha
> >
> > --
> > J.M Chalitha Udara Perera
> >
> > *Department of Computer Science and Engineering,*
> > *University of Moratuwa,*
> > *Sri Lanka*
> >
>
>
>
> --
> Gimantha Bandara
> Software Engineer
> WSO2. Inc : http://wso2.com
> Mobile : +94714961919
>



-- 
J.M Chalitha Udara Perera

*Department of Computer Science and Engineering,*
*University of Moratuwa,*
*Sri Lanka*

Reply via email to