I need to just get those file that resides in a certain VPP path, for example "/Documents/Policys/"
Can I do this using the .Filter() ?
.Match and MatchContains does not seems to work here, I am lost
You can do a prefix filter on the path, ie Filter(x => x.VirtualPath.Prefix("/Documents/Policys")).
Works like a charm, thanks!
I'm guessing that it might not be relevant in this case, but just adding for anyones future reference:
Another option would be to create an extension method for UnifiedFile that returns only the folder(s) part of the path, alternatively some other value depending on the path. The return value of this could then be included when indexing (more on that here). After doing that one could instead filter on that, ie .Filter(x => x.FolderPath().Match(...)).
That in it self doesn't provide much benefit, but the indexed value could then also be used to facet on, for instance creating a UI that contained:
Filter by path
/Documents/A (123)/Documents/B (42)/Images (3142)