Re: remove duplicate when merging indexes

2009-11-10 Thread m.harig
Thanks Ian , it works , thanks a lot. Ian Lea wrote: > > Try updateDocument(new Term("id", ""+i), doc). > > See javadocs for Term constructors. > > > > -- > Ian. > > > On Tue, Nov 10, 2009 at 9:47 AM, m.harig wrote: >> >> Thanks again >> >> this is my code , >> >>  doc.add(new Field("id",

Re: remove duplicate when merging indexes

2009-11-10 Thread Simon Willnauer
Ian got it :) simon On Tue, Nov 10, 2009 at 10:58 AM, Ian Lea wrote: > Try updateDocument(new Term("id", ""+i), doc). > > See javadocs for Term constructors. > > > > -- > Ian. > > > On Tue, Nov 10, 2009 at 9:47 AM, m.harig wrote: >> >> Thanks again >> >> this is my code , >> >>  doc.add(new Fie

Re: remove duplicate when merging indexes

2009-11-10 Thread Ian Lea
Try updateDocument(new Term("id", ""+i), doc). See javadocs for Term constructors. -- Ian. On Tue, Nov 10, 2009 at 9:47 AM, m.harig wrote: > > Thanks again > > this is my code , > >  doc.add(new Field("id",""+i,Field.Store.YES,Field.Index.NOT_ANALYZED)); > >  doc.add(new Field("title", index

Re: remove duplicate when merging indexes

2009-11-10 Thread m.harig
Thanks simon ,, this is my code doc.add(new Field("id",""+i,Field.Store.YES,Field.Index.NOT_ANALYZED)); doc.add(new Field("title", indexForm.getTitle(), Field.Store.YES, Field.Index.ANALYZED)); doc.add(new Field("conte

Re: remove duplicate when merging indexes

2009-11-10 Thread m.harig
Thanks again this is my code , doc.add(new Field("id",""+i,Field.Store.YES,Field.Index.NOT_ANALYZED)); doc.add(new Field("title", indexForm.getTitle(), Field.Store.YES, Field.Index.ANALYZED)); doc.add(new Field("contents",

Re: remove duplicate when merging indexes

2009-11-10 Thread Simon Willnauer
On Tue, Nov 10, 2009 at 10:22 AM, m.harig wrote: > > Thanks simon > >    How I do get the unique ID ? will it be added to the index? There is no such thing build into lucene. You need to generate your own unique ID. Make sure you do NOT use the document ID as it is volatile and is likely to change

Re: remove duplicate when merging indexes

2009-11-10 Thread m.harig
Thanks simon How I do get the unique ID ? will it be added to the index? Simon Willnauer wrote: > > You need some kind of unique ID for you documents like a primary key in a > RDB. > If you have something like that you can call > IndexWriter#updateDocument(uniqueIDTerm, document) this wil

Re: remove duplicate when merging indexes

2009-11-10 Thread Simon Willnauer
You need some kind of unique ID for you documents like a primary key in a RDB. If you have something like that you can call IndexWriter#updateDocument(uniqueIDTerm, document) this will delete the old document and add the new one. simon On Tue, Nov 10, 2009 at 10:05 AM, m.harig wrote: > > hello a