lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: IndexWriter.deleteDocuments(Query[]) not deleting
Date Sun, 22 Aug 2010 22:14:01 GMT
Yep, sure hate it when that happens, which doesn't prevent it
happening to me more often than I'd like :).

Glad you figured it out.

Erick

On Sun, Aug 22, 2010 at 3:04 PM, Paul J. Lucas <paul@lucasmail.org> wrote:

> On Aug 22, 2010, at 1:47 PM, Erick Erickson wrote:
>
> > Did you issue a commit (or close) the IndexWriter after you deleted the
> > documents?
>
> I originally wrote:
>
> > I create/close a new IndexWriter for the delete.
>
> So the answer is "yes."
>
> > ... are you sure your cases match when you submit your term queries?
>
> Yes.
>
> > An interesting test would be to write out the file names you create your
> > terms from, and see what happens if you search on those fields etc....
>
> Never mind.  I figured it out.  (Don't you hate it when you can't figure
> something out, you write-up a detailed question, post it, then go off an
> figure it out afterwards?)
>
> The problem was the directory was being stored in the index like:
>
>        /path/to/file/
>
> (with the trailing slash).  The delete query, however, didn't have the
> trailing slash since File.getAbsolutePath() doesn't return trailing file
> separator characters.  D'oh!
>
> - Paul
>
>
> ---------------------------------------------------------------------
> 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