Re: What counts as "Any Metadata"? [message #1537 is a reply to message #1536] |
Tue, 25 October 2022 19:16 |
FoxTrot Engineering
Messages: 413 Registered: April 2020
|
Senior Member |
|
|
For example, if you added the folder "/Users/Atlas/Documents/Stuff" to the list of indexed locations, and you have a file whose full path is "/Users/Atlas/Documents/Stuff/Project A/Folder B/document.pdf", then its relative path is "Project A/Folder B", and its parent folder name is "Folder B".
By default, "any metadata" will include the parent folder name, i.e. "Folder B"; if you have set the UseRelativePathForParentFolder preference, then "any metadata" will instead include the relative path, i.e. "Project A/Folder B".
However, if you consider a file directly in the indexed folder, instead of in one of its subfolders: "/Users/Atlas/Documents/Stuff/document.pdf"; its relative path should be empty, but in our current implementation (the UseRelativePathForParentFolder hidden preference is an unsupported and poorly-tested feature), it seems that the relative path is in fact the full path, stripped from the file name: "/Users/Atlas/Documents/Stuff". This is probably a bug as this is not consistent, however I am not sure that an empty string would be useful; using instead the name of the parent folder (which is also the indexed folder) would be more useful, but still not consistent.
One solution could be to redefine the relative path so it starts with the name of the indexed folder (e.g. "Stuff/Project A/Folder B"); but if a user indexes his whole home folder ("/Users/Atlas"), which is a common behavior, then his user name ("Atlas") will be stored in the metadata of every document, which would be an unwanted side effect. So I think we should just fix the issue by storing an empty string as the relative path for files directly in the indexed folder.
Jérôme - FoxTrot Engineering
|
|
|