Search for both included and excluded terms fails

I'm battling Advanced Search as always.

As an example, I am trying to find papers where the attachment (PDF) contains "motoneuron", but does not contain "saccade".

* I go to advanced search, set an "attachment contents", "contains" and enter 'motoneuron'. I get lots (50+) of hits.

* I add another criterion "attachment contents", "does not contain", and enter 'saccade'. I get no hits at all.

Just to test, I replace 'saccade' with 'bzbzbzbzbzbzb' - something that should not be in any text anywhere in my Zotero collection. I still get no hits at all.


1) Am I still completely misunderstanding how search works in Zotero?

2) If so, how do I find items where the PDF contains one term but not another?
  • Not you — and not the combination of search conditions, either. If you take out the first one you can see that [Attachment Content] [does not contain] just isn't working at all in "all" mode. I'll take a look.
  • edited February 19, 2014
    this looks like a bug when combining contains and does not contain for attachment contents. I can reproduce that, doesn't depend on search terms or any of the checkboxes. All searches with match="all" and
    attachment content --> contains
    attachment content --> does not contain
    are empty

    edit: Dan is right. I though I had gotten a result on "does not contain", but that's not the case.
  • OK, I believe this is fixed in the latest 4.0 Beta — feel free to try it out and let me know. I'd guess that this has been broken for over 6 years, so I don't think this part of the code gets a whole lot of use.

    (A non-matching Attachment Content condition now matches all items — attachments or not — which is weird, but consistent with Attachment File Type.)
  • OK, I'll try it.

    One note though: I am almost 100% certain that this used to work at some time (can't tell you when, as updates are transparent). I have relied on doing this before when I do one of my periodic clean-ups of my paper piles.
  • Doesn't work. Just searching for something that does not match works, in the sense that I get a list of results. But combining it with something that must be there does not work; it gives me an empty list no matter what the search terms are.


    Would it be untoward to ask for an optional, experts-only, if-it-breaks-you-keep-the-pieces regexp interface for searching?

    Oh, and a way to prune the list of search types would be nice. I only ever use exactly three items in that list - attchement contains, note contains and tag - and finding those three in a loooong drop-down list each and every time is pretty frustrating.

    In fact, my dream would be to let me specify and name a "group" of search fields (those three above) and just let me search in that group by default.
  • edited February 19, 2014
    Really? It works for me.

    1) Google for "PDF".

    2) Download the W-4 form and save to Zotero. Do a quick search in "Everything" mode for "tax" to make sure it's indexed.

    3) Open the advanced search window: mode "all", attachment conditions [Attachment Content] [contains] ["tax"] and [Attachment Content] [does not contain] ["foo"], nothing checked.

    It finds the PDF for me.
    Would it be untoward to ask for an optional, experts-only, if-it-breaks-you-keep-the-pieces regexp interface for searching?
    It already exists. Click the drop-down in the Attachment Content condition.
  • edited February 19, 2014
    I search:

    * Title, contains, "saccade"
    * Title , does not contain, "bzbzbzbzbzbzb"

    Works. It seems to give me roughly the same set of documents.

    I search:

    * Attachment contents, contains, "saccade"
    * Attachment contents, does not contain, "bzbzbzbzbzbzb"

    Gives me zero documents. No checkboxes make any difference.

    * Removing the "does not contain" condition gives me a long list, as expected.

    * Just in the unlikely case that I have added "bzbzbzbzb" to all my documents by mistake, I also look for "does not contain", "xyzzybubliapp" with the same results.

    Edit: If I have "attachement contents", "does not contain" with anything, or nothig at all, then it will always return no hits no matter what other conditions I have or not.

    It already exists. Click the drop-down in the Attachment Content condition.
    Neat! But I was thinking one level up; where I can really search the entire text and metadata of posts, not just a specified field.
  • I thought I was running the 4.0 beta linked above. Of course, I had forgotten to actually restart Firefox so I never tested with the beta. Restarted, and indeed, the search now seems to work fine. This is why I should not be allowed near heavy machinery.

    Thanks!
Sign In or Register to comment.