lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Updating a document
Date Fri, 10 Jun 2011 11:34:49 GMT
In different code samples you've got both DocId and DocID.  If that
isn't the problem I suggest you post a complete little program that
demonstrates the problem.  As small as possible, no external
dependencies.


--
Ian.


On Fri, Jun 10, 2011 at 12:24 PM, Pranav goyal
<pranavgoyal40341@gmail.com> wrote:
> Hi Danny,
>
> I have explained it above.
>
> It has many fields out of which DocId is the field which I am storing as
> well as indexing. While other fields I am just storing.
> And Each document has unique DocId.
>
> d=new Document();
> File indexDir = new File("./index-dir");
> StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_31);
> IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_31, analyzer);
> try {
>      writer = new IndexWriter(FSDirectory.open(indexDir),conf);
> } catch (IOException e1) {
>     e1.printStackTrace();
> }
> String q1 = contract.getDocId();    // Here I am getting my DocId
> Term term = new Term("DocID",contract.getDocId());
>
>
> Rest I have stated above.
>
>
>
> On Fri, Jun 10, 2011 at 4:44 PM, Danny Lade <dannylade@googlemail.com>wrote:
>
>> You delete it first using your id:
>>
>> >            writer.deleteDocuments(term);
>> >
>>
>> and then re-add it with the same id:
>>
>> writer.addDocument(d);
>> >
>>
>> Please explain:
>> How looks your document BEFORE you try to delete it? (Which fields has it?)
>>
>> Greetings Danny
>>
>
>
>
> --
> I'm very responsible, when ever something goes wrong they always say I'm
> responsible --
>

---------------------------------------------------------------------
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