1. A method, comprising: detecting data fields on a scanned image corresponding to a new document type; generating a flexible document description for the new document type based on the detected data fields, including creating a set of search elements for each data field, each search element having associated search criteria; and training the flexible document description using a search algorithm to detect the data fields on additional training images based on the set of search elements.