>
> doc.add(new Field(ID_FIELD, id, Field.Store.YES, Field.Index.NO));
> writer.deleteDocuments(new Term(ID_FIELD, id));
> int i = reader.deleteDocuments(new Term(ID_FIELD, id)); //i returns 0
> Both failed. I try to delete one id value that I know for sure it was added
> in the first step.
>

For deleting by term it needs to be searchable, that is - indexed.
This should work the deletions:
  doc.add(new Field(ID_FIELD, id, Field.Store.YES,
Field.Index.UN_TOKENIZED));

Doron

Reply via email to