Stringing together advanced searches

I encountered something puzzling while running a series of advanced searches. I am trying to find all items in a specific collection where the attachment contains any of several terms. That is, the search logic is <"Collection is X" AND "Attachment Content contains (A OR B OR C OR D)">. I'll describe what I did conceptually using familiar Boolean terms rather than the any/all conditions the Zotero interface actually uses.

First, I created a saved search for:
(1) <"Attachment Content contains A OR B OR C OR D">

then another saved search for:

(2) <"Collection is (1)" AND "Collection is X">

The contents of (1) and (2) were the same, so that didn't work. Later, on a whim, I tried:

(3) <"Collection is X" AND "Collection is (1)">

and that DID give me what I was looking for. One wouldn't normally expect the order of a series of conjuncts to make a difference.

My immediate problem is solved, but thought I'd flag this to see if anyone can explain why this works the way it does, and in case it helps anyone else facing a similar problem.
  • The order isn't relevant. I suspect what happened is just that you enabled "Include parent and child items of matching items" in (1) at some point — which is required for this to work — but the results of the second search had been cached. Making a change to the second search — any change — triggered a reload based on the updated parent search. Restarting Zotero would've had the same effect.

    I've created an issue to track this, though I don't know when we'll get to it.
  • Ah, that makes sense. Thanks for the explanation!
Sign In or Register to comment.