Always use Search Results folder type when viewing search results

Is there anyway to ensure that the Search Results folder type format is always used when I’m seeing search results?

Currently depending on the type of content that’s returned from the search results a content type format will take precedence meaning I don’t get the search results columns I want such as location.

Which type of search/find are you doing?

I have two areas where I’d like this.

The first is a button I use to view files modified over the last 7 days using the following command

Go " C:\Users\blahblah\"
Find QUERYENGINE=everything QUERY dm:last7days !attrib:HS files:"C:\Users\blahblah\"

The other is a tab that I have saved as part of the default Opus Window which also displays the above but it’s there as soon as I open Opus without the need to press a button.

I tried altering the button to include the following command which just gets ignored. If I add this command into a seperate button and click it once the search results have loaded up then it works. So it seems to be an issue when trying to use the Set FORMAT alongside the Go and Find commands.

Set FORMAT=!default

I’m not sure how I’d get around this issue or how I could apply it to the tab I have open when I run Opus

Edit: I’ve noticed that despite having the folder path in the Find query it was actually restricted to searching whatever folder I had in the lister at the time even though I always want it search my OneDrive. I’ve therefore had to add a Go command as the first line taking me the OneDrive folder and then performing the search. The final line that should be changing the folder format doesn’t work now. If I have the Set FORMAT commad in a separate button that I click on it does change the folder format.

I think the problem is caused by the Go command which then triggers one of the file content formats before the search actually gets made.

One thing you can try is the IN argument for find like this, without using the Go command at all:

Find IN="C:\Test\" QUERYENGINE=everything QUERY dm:last7days !attrib:HS files:"C:\Test\"

When I tested the original version you posted vs that with a folder full of images, the original indeed switched the folder format view, but that one seems to keep the search results view. So I think that will work.

Also you mention the Find command only searching within the current folder. I believe that is because of the difference between everything and everythingglobal as the QUERYENGINE value. It doesn't seem very well documented yet but it's mentioned on this wiki page:
https://docs.dopus.com/doku.php?id=reference:command_reference:internal_commands:cli&s[]=everythingglobal

Where it says:

everything | Search the current folder using Everything
everythingglobal | Search the whole system using Everything

I think doing IN basically does the job of switching folders so that just using everything instead of everythingglobal is enough if you just want to search within a specific folder, but ensures the search result format is used.

If you want to search the whole system you can use everything global like:

Find QUERYENGINE=everythingglobal QUERY dm:last7days !attrib:HS

Though it seems like that, without IN, ends up using automatic folder formats again. I'm sure there's a way to get format to work, it might be that whatever folder format is applied has some setting that doesn't override certain views, I vaguely remember seeing something about that, could be wrong though.


Edit: Ok so for my last point, I was able to figure out how to get it to always use a certain folder format for the results. And this probably more directly addresses your original question in your first post.

Turns out the behind-the-scenes path for the various queries are different. The command using IN apparently produces a result path starting with coll://Find Results, while the other one produces a result path in coll://%%Lister-Quick-Find-Results%%/...

So what we can do is go into the Preferences > Folders > Folder Formats, then click "Add" > "Path Format", and at the text box in the bottom enter this:

coll://%%Lister-Quick-Find-Results%%

The "Edit Format" window will come up but just hit "OK" for now to close it. Back in the Folder Formats preferences, look in the "Folder Type Formats" section, right click "Search Results", and hit Copy. Then right click on our new "Lister-Quick-Find-Results" path format and hit Paste. Finally double click our new format to bring up the Format Editor, and at the bottom left check the box that says "Use as the default format for all sub-folders", then hit OK.

I believe that should now apply even with the everythingglobal example i gave above. If you want, you can also do the same process for Find Results by using the path:

coll://Find Results
2 Likes

What a great detailed post.

I’ve just experimented with the IN keyword as you suggested and it does indeed seemed to have fixed both the issue with the folder format and also it ignoring the folder to search in.

I’ve got a couple of other Everything search buttons setup and the everythingglobal keyword will come in useful in one of those and thanks for the tip on adding the path format.