Excluding specific Groups in a search

Is there a way in which I can exclude certain Groups, (usually only one) in setting up a search in DEVONthink Pro Office?

Tools > Show Info … > Exclude From …

korm describes how you can exclude a group from a search, but I suspect that you wish to exclude the contents of the group from a search as well. Excluding a group from searching via the Info pane does not cause the contents of the group to be excluded. I know because I have requested in the past that it be an option to include all the children (sub-groups and documents) when excluding the parent group. You’ll need to exclude each document in the group(s) individually to have them not appear in a search.

Greg’s additional suggestion is good – and the fastest way to do this exclusion of all the documents in a group is to select them all and once again use Tools > Show Info… > Exclude from… on the entire selection at once. Certain features of Show Info will work on multiple selections (whether contiguous or non-contiguous).

This triggered script that can be added to a group in Show Info… > Script will automatically set that attribute for all the children of a group

on triggered(theRecord)
	tell application id "com.devon-technologies.thinkpro2"
		
		set thisGroup to current group
		tell every child of thisGroup
			set exclude from search to true
		end tell
		
	end tell
end triggered


That is exactly it, sorry I was not clear.

But thanks Korm. I have tried this and also have had a look in the Manual as advised :wink: but still the search does not entirely exclude a group from my search. Here is a screenshot.


My intention is to exclude the contents of the group 'Allsop, Andrew 1946’ from the search but, as you can see from the second screen shot, there are still some items from that group included in the results—see especially first two items. I presume I am doing something wrong…it normally is! Many thanks for your help.

Has this been addressed yet?

Must have posted my last shortly after Korm’s reply. Sorry.

Still got the occasional result in not wanted Group showing up but it is a lot better!

I suggest inspecting the unwanted-found documents to see if the “exclude from search” flag is set.

Problem solved. I had two Groups in different open databases named Allsop, Andrew 1946 one was excluded from search the other wasn’t! A valuable lesson learnt to make sure Groups have unique names even if in different databases. :bulb: