Evening,
Back on June 17, 2004 and July 1, 2004, Michael Chaney posted a couple
of questions regarding a problem he was having with delete_term(). I
don't see any responses to his query, but I ran into the same problem
while using Plucene.
Now, I don't know exactly what Michael was doing, but I can state that
delete_term() _does_ work assuming you have indexed the field using
either:
Plucene::Document::Field->Text()
Plucene::Document::Field->Keyword()
Plucene::Document::Field->UnStored()
If, however, you use Plucene::Document::Field->UnIndexed(),
delete_term() _will not_ work. There will be no error message, but the
documents containing the term in that field will not be deleted.
After tracking down this problem it's now obvious why using an UnIndexed
field would not work. The field is _unindexed_; therefore, Plucene has
no way of locating the field in the index (since it's not in the index)
and, therefore, no documents match and no documents are deleted. The
other three methods all store the term in the index, so it can be found
by delete_term().
The documentation concerning this is not clear (at least it wasn't to
me), but I think the real error here is that no warning or error message
is generated when trying to use delete_term() with an unindexed field.
I'm not sure how to fix the problem, but I thought I would point it out
for future reference.
-- Robert
--
Robert James Kaes
WormBytes Consulting and Contracting
http://www.wormbytes.ca/
|