fix missing fragment portion of LocalPath (#6257)

This commit is contained in:
Jeremy Wu 2020-09-04 05:46:34 +10:00 committed by GitHub
parent 6ce47e5cd9
commit 807fbd4d89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,10 @@ namespace Microsoft.Plugin.Indexer.SearchHelper
continue;
}
var uri_path = new Uri((string)oleDBResult.FieldData[0]);
// # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path
var string_path = ((string)oleDBResult.FieldData[0]).Replace("#", "%23", StringComparison.OrdinalIgnoreCase);
var uri_path = new Uri(string_path);
var result = new SearchResult
{
Path = uri_path.LocalPath,