advanced search not working

I am trying to locate all records that don't have pdfs attached. I set advanced search to: Attachment File Type is not PDF. Yet, in the search results, I see several items with PDFs attached. The pdfs are grayed out. I've tried all of the combinations of the check boxes. What am I doing wrong? I'm on Zotero 2.0.3.
  • edited May 14, 2010
    The conditional logic does seem to be out of tune for this item (although it's not perfectly clear what it should be returning: "items with attachments that are not PDF", or "items without a PDF attachment"). You can still find items without PDF attachments, it will just take a few additional steps:
    1. Open an item that does have a PDF attachment, and set a tag on it "have-pdfs" (or whatever -- a descriptive tag to that effect that does not already exist on your system);
    2. Do a library-wide search for "Attachment type is PDF";
    3. Save the search;
    4. Using the saved search, tag all of the top-level items (open the tag selector with ctrl-alt-T, highlight the items, drag them to the have-pdfs tag);
    5. Do an advanced search for "Tag is not have-pdfs".
    Someone else may have a more economical solution, but that should work.
  • That should work at any one time, but not as an ongoing strategy. I want a saved search that I can look at that will automatically show me all records without pdf attachments without me having to manually tag anything.

    Is there a bug with advanced search in terms of 'attachment is not pdf'?
  • edited May 21, 2010
    I'd say so. (Edit: see Dan's responses below.) As you say, the returns from an "attachment is not PDF" search don't fit that description in either of its possible meanings.

    When the devs come around to look, I'd guess their first concern will be with the ambiguity of this search phrase. One way to clarify things might be to just scrap it, and provide the UI with an "invert search" toggle, which is effectively what the workaround does.

    In any case, I do agree with you that this should be ticketed.
  • it's not perfectly clear what it should be returning: "items with attachments that are not PDF", or "items without a PDF attachment"
    Neither. The attachment conditions currently only match attachments. They don't match regular items. So it doesn't mean "item with a PDF attachment"—it means "PDF attachment".

    [Attachment File Type] [is not] [PDF] is actually just finding all items that aren't PDF attachments (i.e., the inverse of the [is] search). Granted, this doesn't really make much sense, but you can add an additional [Item Type] [is] [Attachment] and then check both "Include parent and child items of matching items" and "Only show top-level items" to find parent items without PDF attachments. (At least, that appears to be the case, but I tested this quickly.)

    None of this is to say that some of the search conditions don't need some attention.
  • OK, scratch that. My workaround doesn't work when a regular item doesn't actually have any child items—only when it has child items that aren't PDF attachment.

    There may not be another way to do this currently.
  • For what it's worth, the lack of an ability to do this isn't really a bug. The only search condition (I believe) that currently matches parent items based on child items is "Child Note". Others simply don't exist.
  • The ability to find parent items based on child items seems like a very useful feature. I have thousands of journal article citations, and I would like to make sure that they have pdf attachments so that I can do a full-text search of the articles, but to go through the citations manually is impossible.

    Can this feature be put on a soon-to-do list?
Sign In or Register to comment.