// Add the tag-stripped contents as a Reader-valued Text field so it will
// get tokenized and indexed.
addTextField( document, "contents", reader );
PDDocumentInformation info = pdfDocument.getDocumentInformation();
if( info != null )
{
addTextField( document, "Author", info.getAuthor() );
addTextField( document, "CreationDate", info.getCreationDate() );
addTextField( document, "Creator", info.getCreator() );
addTextField( document, "Keywords", info.getKeywords() );
addTextField( document, "ModificationDate", info.getModificationDate() );
addTextField( document, "Producer", info.getProducer() );
addTextField( document, "Subject", info.getSubject() );
addTextField( document, "Title", info.getTitle() );
addTextField( document, "Trapped", info.getTrapped() );
}
int summarySize = Math.min( contents.length(), 500 );
String summary = contents.substring( 0, summarySize );
// Add the summary as an UnIndexed field, so that it is stored and returned
// with hit documents for display.