lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Attardi" <jatta...@gmail.com>
Subject Re: IndexWriter.updateDocument(Term, Document) not removing old Document?
Date Tue, 03 Jul 2007 21:09:23 GMT
Hi Chris,

That did it! Thanks for the help. I should have read the javadocs for
Field.Index more closely!
Thanks to everyone else for their input too.

-- 
Joe Attardi
jattardi@gmail.com
http://thinksincode.blogspot.com/

On 7/3/07, Chris Hostetter <hossman_lucene@fucit.org> wrote:
>
>
> It sounds like your problem is that your id field is analyzed and as a
> result contains more then one token per document ... both the
> deleteDocument and updateDocument methods that take in a Term only remove
> documents that have that exact Term in them.
>
> You need to add your documents with the "id" field as UN_TOKENIZED in the
> first place, and then updateDocument and deleteDocument should work (note:
> your use of "\"" in building your Term also looks suspicious, like you
> expect ther Term text to be analyzed into a phrase .... it's not, it's
> literal term text).
>
> : id:"com.mycompany.myapp.FooBar 142"
>
> : Term term = new Term("id", "\"" + doc.get("id") + "\"");
>
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message