We are developing a document-management system in .NET 4.0 that is required to search stored documents (common document formats, e.g. doc, rtf, pdf). The system has to meet the following criteria:
1. Should work in a client-only environment
2. Search in the file name and the contents of the document by simple keywords
3. Return approximate matches (i.e. perform full-text search)
4. The query should return the name of the matched file and the context of the match (a basic text representation of the content near the match)
Currently we are trying to use Windows Search 4.0, but we are having difficulties implementing requirement #4: retrieving the query context. The documentation (e.g.
suggests that this functionality exists, but we have not been able to find a single sample on the web that utilizes it. Could you provide us with a code sample/point us to the appropriate documentation? If this problem cannot be solved in pure managed code
(which I think is highly probable) then we would be glad for any solution if the gap can be bridged (e.g. P/Invoke, etc.).
If all else fails could you suggest an alternative solution that satisfies our requirements?