To illustrate my requirements consider the following directory structure:
C:\Dev
C:\Dev\Projects
C:\Dev\Projects\Test Project
C:\Dev\Projects\Test Project\Test.cs
C:\Dev\Projects\Foo
C:\Dev\Projects\Foo\foo.cs (containing the word test)
The basic document will have id, type, name and content fields, where type will be file or folder and name will be ether file name or folder name.
When searching for "test" I should get:
C:\Dev (ancestor of a result)
C:\Dev\Projects (ancestor of a result)
C:\Dev\Projects\Test Project (result)
C:\Dev (ancestor of a result)
C:\Dev\Projects (ancestor of a result)
C:\Dev\Projects\Test Project (ancestor of a result)
C:\Dev\Projects\Test Project\Test.cs (result)
C:\Dev (ancestor of a result)
C:\Dev\Projects (ancestor of a result)
C:\Dev\Projects\Foo (ancestor of a result)
C:\Dev\Projects\Foo\foo.cs (result)
Even better if it possible to avoid duplications:
C:\Dev (ancestor of a result)
C:\Dev\Projects (ancestor of a result)
C:\Dev\Projects\Test Project (result)
C:\Dev\Projects\Test Project\Test.cs (result)
C:\Dev\Projects\Foo (ancestor of a result)
C:\Dev\Projects\Foo\foo.cs (result)
When searching for "project" I should get:
C:\Dev (ancestor of a result)
C:\Dev\Projects (ancestor of a result)
C:\Dev\Projects\Test Project (result)
When searching for "foo" I should get:
C:\Dev (ancestor of a result)
C:\Dev\Projects (ancestor of a result)
C:\Dev\Projects\Foo (result)
C:\Dev\Projects\Foo\foo.cs (result)
Thanks for any help