getItems method return empty object

Hi, I tried to get value of item object but it returns empty object but it works fine windows machine.

if(lEachDocument.hasItem(IndexFields.BODY)) {

Vector bodies = lEachDocument.getItemValue(IndexFields.BODY);

System.out.println("Body size "+bodies.size());

for (int i = 0; i < bodies.size(); i++) {

	String s = "" + bodies.get(i);

	lBody.append(s + " ");

	logger.info("Body text "+s);

	System.out.println("Body "+s);

}

}

Log Result:

bodies.size() – 0

lEachDocument.hasItem(IndexFields.BODY) - true

Vector vector = lEachDocument.getItems(); - it is also not returning any items

Subject: Seen this before

Hi,

I’ve seen this behaviour before if the doc you’re trying to read is deleted or corrupt. Did you check what the isValid() or isDeleted() properties of the document return?

Mark