When you say it isn't working very well, what do you mean? It's slow? It's
not removing what you expect? If the latter, I suspect you're tokenizing the
term when you index such that it's not being found correctly....

You need to, somehow, get the Lucene document ID to remove. You can either
do a search, or you can use the termenum/termdocs classes to find out what
documents contain the term you want.


Best
Erick

On 1/10/07, Fernando G Bernardino <[EMAIL PROTECTED]> wrote:

Hi People!

My app needs to update documents from index, so I have to remove and
insert again, all right?

First I wrote this code:
---
        IndexReader reader = null;
        try
        {
            String index = Webp.getProperty("webp.search.indexFolder");
            Directory directory = FSDirectory.getDirectory(index, false);

            reader = IndexReader.open(directory);
            reader.delete(new Term("contentPid",
String.valueOf("C_"+content.pidObject())));
        }
        ....
---

But It's not working well.. I want to use de method 'reader.delete(int)'
but I can't discover the document 'ID' to use as parameter.
I wrote some code to return the documents that I have to delete. How can
I get that ID?

Thanks!

--
Fernando Bernardino

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to