A method and system for searching digitally annotated computer documents,
including searching the annotations. An annotated document may be open
for viewing by a user, or alternatively present among closed files that
are searched to find files that match a query. In one implementation, the
document data and the ink-annotation data exist on two separate layers,
with each layer having associated text content, whether as original text
or as annotations that are recognized as text. When a user issues a query
to search the annotated document, the query is passed to a search engine
that performs the pattern matching on the text in each layer, to produce
search results. The search engine may produce a search result data
structure for each match, which may be sorted with other data structures
into a list, such as sorted by pages and coordinates, to present them to
a user in a logical ordering.