}
// index the document
Indexer indexer = new Indexer(indexDirectory);
try {
indexer.open();
if (labelDoc != null) {
IndexableField existingContent = labelDoc.getField(Indexer.CONTENT_FIELD_NAME);
indexer.updateDocument(existingContent, sb.toString(), label);
} else {
indexer.addDocument(sb.toString(), label);