More complex advanced search using a combo of ands and ors

Perhaps there's an existing way to do this but I would really like to do a search of, say,

Collection is "Foo" AND Item Type is "Note" OR Item Type is "Attachment".

Is this possible already through some other search criteria? Any suggestions?
  • You can't do this in a single search, but you can chain multiple saved searches together to achieve the same effect. Create one search for Item Type is "Note" OR Item Type is "Attachment" and another search that uses that search as the source via the "Collection" condition and adds the Collection is "Foo" condition.

    There might be glitches though, since the code that handles more complex boolean logic like this is currently a bit ugly (since it tries to deal with full-text searches that happen outside the database). The problems might be limited to "Include parent and child items", though.
  • Hi Dan,

    Great suggestion - and it sounds like in theory it should've worked, but sadly didn't. It caused an error (submitted as 1641258498)

    On the other hand, I got (almost) what I wanted by doing the following:

    Saved search for notes - Item type = Note AND Collection is Foo, search subfolders and include parent and child (not sure why I have to include parent and child, which I technically wouldn't want, but that's ok for now)

    Saved search for attachments - Attachment file type = Image AND Collection is Foo

    Combined search - Collection is notes OR Collection is attachments

    Re: the first collection of notes, is there any reason why it won't show up with anything when "show child and parents" isn't checked? From a research-y point, what I wanted to do is browse notes and images with the coding/tags I had added, and when it picks up the parent items too it tends to add in its automatically added tags which I'm not as interested in.
  • Also a bit of warning - when you export library (as I did just yesterday for reformatting the ailing computer) it doesn't include your saved searches.
  • We'll look into that error.

    Child items don't technically "belong" to collections—only parent items do—so no child notes will show up if you specify a collection without including parents and children. This is a bit limiting, so there'll probably be a fix for this eventually.

    You don't want to use import/export for backup and restore. See Troubleshooting Zotero Data.
Sign In or Register to comment.