By the way, I have developped the core of a search engine completely in Haskell.
It can index arbitrary objects (including files, of course)
has definitions for filters, with predefined filters for plain text, HTML/XML and a general filter for Haskell data types
It has basic search capabilities: it returns a list of identifiers (URIs) of the objects that contains all the entered keywords.
But it is fairly easy to accept arbitrary AND OR and NOT conditions. Just query parsing is necessary.
More info:
The source of Search.hs can be found here