while (sampleData.hasNext()) {
SpatialTestData data = sampleData.next();
Document document = new Document();
document.add(new StringField("id", data.id, Field.Store.YES));
document.add(new StringField("name", data.name, Field.Store.YES));
Shape shape = data.shape;
shape = convertShapeFromGetDocuments(shape);
if (shape != null) {
for (Field f : strategy.createIndexableFields(shape)) {
document.add(f);
}
if (storeShape)//just for diagnostics
document.add(new StoredField(strategy.getFieldName(), shape.toString()));
}
documents.add(document);
}
return documents;