I'm guessing that your problem is what gets indexed. What analyzer
are you using when indexing? One that breaks words apart on, say,
periods?

The way to check this would be to get a copy of Luke and examine
your index (or part thereof). Google (lucene luke). It'll help
greatly.

What is your evidence that the doc still exists? Have you closed/reopened
your reader before you check this? Remember that index changes aren't
visible for an already-opened reader.

Best
Erick

On 7/3/07, Joe Attardi <[EMAIL PROTECTED]> wrote:

Hi everybody,

First-time poster here. I've got a search index that I am using to index
live Java objects. I create a Document with the appropriate fields and
index
them. No problem. I am indexing objects of different types, so I have an
"id" field in each Document which consists of the object's class name
followed by a unique ID number, so for example
"com.mycompany.myapp.FooBar142". When the objects get updated, I make
a new Document and call
IndexWriter.updateDocument as follows:

IndexWriter indexWriter = new IndexWriter(INDEX_PATH, new
StandardAnalyzer(), false);
Document doc = buildDocumentFor(object);
Term term = new Term("id", "\"" + doc.get("id") + "\"");
indexWriter.updateDocument(term, doc);
indexWriter.close();

The call to update() goes off without any problems, and the new Document
gets added to the index. But when checking the index, I find that the old
Document still exists.

Am I missing something? The Javadoc for updateDocument states "Updates a
document by first deleting the document(s) containing term and then adding
the new document. The delete and then add are atomic as seen by a reader
on
the same index (flush may happen only after the add)."

Thanks for your help..

--
Joe Attardi
[EMAIL PROTECTED]
http://thinksincode.blogspot.com/

Reply via email to