Full path sorting in search

What I’m trying to do

I’m searching all the files that contain “some text” in the path by including path:"some text" operator. I want for resulting list to be sorted by full path of the file. And I want to be able to pick the type of sorting in the Search Embed block.

Things I have tried

The default “sort by filename” is insufficient, as it ignores the path of the file.

1 Like

The example you provide, path:"some text", will list all files in a folder “some text”. To clarify your question, you may want to correct. Probably you mean `path:“some path” “some text”? Then you probably have subfolders under the path that you search? It is my impression that the default sort order is “path” then “filename”.

Indeed it would be good to be able to change the sort order, the way you can do with Search in the left pane. That would require implementing some query syntax. This is currently not possible and thus potentially a feature request.

To clarify, in this case the use of path:"some text" to search in the path, not the file contents, is intended.

Furthermore, path:"some text" will list files in ALL folders in the vault that contains "some text" in the path, not just A folder. The current issue is that in the sorting of the resulting list paths are ignored, and only filenames are used for sorting.

This is very clear now. And indeed, the note title aka file name is considered one part of the path.

I suggest you edit your first post to be very clear from the start. Results indeed are presented as an ASCII sort on file name. Still, my opinion is that this is a feature request, both at the level of the code block, where there is no control, and at the level of the left pane, where an option to sort by pathname is not available.

You can consider the Dataview community plugin for more powerful queries.

Thanks for the response. Made a feature request.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.