Many occurrences in the same database but only at the same time

Hello, could someone kindly tell me how to get 2 occurrences AT THE SAME TIME? I use the AND combination, but I always get the two separate occurrences in the search set, whereas I only want to get the two AT THE SAME TIME. Thank you very much in advance.

An image might help. I don’t understand what you’re after.

Hello dear friend, thank you for your quick response to my question. In fact, for example, if I want to search my database for a reference that contains two keywords AT THE SAME TIME, I request the search for the 1st keyword and then add the 2nd keyword, separating them with the AND operator. My problem is that I don’t necessarily get both at the same time, as I’d like.

Clearly, I want to get the 2 occurrences at the same time, i.e. associated (only, but not separated).

You should use the NEXT operator in this case. See the “Search operators” section of DT’s manual or built-in help for reference.

Here’s an example. I’m looking for the following 2 occurrences at the same time: “Atrial fibrillation”. I get both but they are not systematically associated as I would like. See the screenshot

Does “systematically associated” mean “the words should be next to each other” (“atrial fibrillation”), then use the NEXT operator, as suggested by @meowky.

If you use AND, DT will give you all documents containing both words somewhere.

The documentation’s chapter on “Search operators” and “Search prefixes” contains detailed explanations and examples.

1 Like

As @meowky suggests, have a look at the manual. You can also ask for ‘word1 NEAR word2’ and specify how far apart to look. From appendix - search operators:

  • term1 NEAR term2: term1 occurs 10 words or less before or after term2
  • term1 NEAR/n term2: term1 occurs n or less words before or after term2
  • term1 BEFORE term2: term1 occurs before term2
  • term1 BEFORE/n term2: term1 occurs n or less words before term2
  • term1 NEXT term2: term1 occurs right before term2 (shortcut for BEFORE/1)
  • term1 NEXT/n term2: term1 occurs n or less words before term2 (synonym for BEFORE/n)
  • term1 AFTER term2: term1 occurs after term2
  • term1 AFTER/n term2: term1 occurs n or less words after term2
1 Like

I can’t thank you enough for all your help with this amazing Devonthink tool. You’ve been such a great support! I’ll absolutely follow your advice to the dot, thank you so much! Wishing you all the very best day!

You should quote the search string exactly as you have it here: "atrial fibrillation" and use the text: search prefix if you’re searching for content-based matches.

3 Likes

Thanks so much, BLUEFROG! I’m really sorry, but I don’t quite understand what you mean. On the other hand, I found that by separating the two occurrences with “near,” it worked perfectly as I wanted. I really appreciate your comment, thank you so much!

As mentioned in the Search Operators section of the manual, if you are looking for specific phrase, you should quote it.
And if you’re looking for contents in a document, you should use the text: search prefix, e.g., text: "atrial fibrillation.

2 Likes

The OP apparently was looking for “atrial fibrillation” as a combined term. So, the solution by @BLUEFROG fits the bill, no NEAR needed.

1 Like