Advanced search doesn't match all the criteria when including 'Attachment file type':

For example, I enter [Item Type] [is] [*whatever*], then [Attachments File Type] [is] ["whatever"] results in an empty return. I have almost all my attachments as pdf but it also happens selecting pdf (for "whatever" I mean).

Having more "row conditions" added doesn't change the behaviour. And the [ItemType] alone with other conditions works in the cases I've tested. So the problem seems to arise when [attachment File type] [is].. is combined with [Attachments File Type] [is]...
Yet, although [Attachments File Type][is] works with some other combinations, it doesn't work in combination with others apart from [Item Type], so it shares a bigger part of the responsibility.

Can't test it now thoroughly, but I'm pasting a combination that doesn't work for sure:
Here, the first condition working:
https://imgur.com/a/wqvj3mC
Now, adding, the [Attachment File Type][is], that results in an empty return:
https://imgur.com/cJnvZ1e

Sometimes, maybe after clicking twice in "include the parent..." it just returns all as if the second condition wasn't added... But can't find a clear pattern here either...
  • edited May 6, 2021
    This isn't a bug. [Attachment File Type] matches attachment items. If you also select [Item Type] [is] [Book], there can be no results, because an attachment item isn't a book item. The search system is designed to give fine-grained control over exactly what matches, which is important for some use cases, so it doesn't consider parent and child items a single unit.

    If you want to match only PDFs that are child items of books, use two searches. Create one with [Item Type] [is] [Book] and [Include parent and child items of matching items], and save it as a saved search. Then do another with [Collection] [is] [name-of-saved-search] and [Attachment File Type] [is] [PDF].

    Some improvements in this area to avoid the extra saved search are generally planned, but I don't know when they'll happen.
  • Oh, now it totally makes sense. Thanks @dstillman, I'm starting to love Zotero again...
Sign In or Register to comment.