Searching in DevonThink

Using Tools > Search…

I’d like to search for “Alexander Ha”. I don’t want any hits on documents with either Alexander Smith or James Ha. But instead any document with both of them in that specific string. I want it to provide a hit on “Alexander Haig” as well as “Alexander Hadley”, should either exist.

Is this possible:

  1. Search for contiguous string of multiple words (quoting doesn’t seem to help.

  2. Find strings that are not limited to whole words only.

Many thanks for any input.

– Gerry

Just use the Wildcards option and search for Alexander Ha

Wildcards. Okay, I see there is a button named “wildcards”. I’ve toggled it.

I just searched for “the development”. And it found nothing. so I assume I’m to use asterisks as you did. I search for the development. I can find 8 documents with either word, apparently only one of them in that specific string. I’m not sure which, because, I note also that it no longer highlights the “find” in blue in each document. How do I limit the search to that specific string, rather than either of those two words?

Does the blue highlighting go away if you use wildcards?

– Gerry

Hi, Gerry. Note that the wildcard operator with use of the asterisk symbol works for searching document names, but not within document content or other document metadata.

The Phrase operator can be useful for searching in the content of documents (as well as in Name, URL/Path, Comment).

For example, I just did a Phrase search of my database using the query string the development and ignoring case. Result: 1,726 items found in 0.384 seconds. Note that in addition to “the development” a Phrase search will also possibly display extensions such as “the developments” and “the development’s”. The string “the development” will be highlighted in selected documents.

Going back to your first post, suppose you want to find all of the documents that contain either the strings Alexander Haig and Alexander Hadley. You could use an All Words search for Alexander, Haig, Hadley, but that could be very imprecise, including additional documents such as one referring to Alexander Smith, George Haig and Thomas Hadley.

You can use only one string in a Phrase search. So you can’t (currently) do a single query such as Alexander Haig OR Alexander Hadley.

Here’s the trick: First, create a new group that’s to hold some search results.

Do an All, Phrase, Exact search for Alexander Haig. Select all of the search results and replicate them to that new holding group. Now do an All, Phrase, Exact search for Alexander Hadley. Select and replicate the search results to that holding group. Presto! You’ve collected a list of all the documents that refer to either or those gentlemen.

Now, suppose you want to either limit the documents to those that also refer to Austria, or perhaps you wish to exclude those that also refer to Austria. Easy.

Let’s start with excluding references to Austria, so that we’ve achieved a search that could be expressed as (“Alexander Haig” OR “Alexander Hadley”) NOT Austria.

And we’ll kill two birds, so we’ll cover the first case as well. Create a new holding group. Do a search for All, Phrase, Exact that’s limited to the first holding group’s contents. The query term is Austria (as this is a Phrase search, it will also pick up Austria’s and Austrian). Select those search results and move (instead of replicating) them into the second holding group.

Now the first holding group contains replicates of all the documents in your collection that meet the condition (“Alexander Haig” OR “Alexander Hadley”) NOT (Austria OR Austria’s OR Austrian). The second group contains those documents that meet the condition (“Alexander Haig” OR “Alexander Hadley”) AND (Austria OR Austria’s OR Austrian).

Just wanted to point out that one can do rather complex searches by adding techniques of conjunction and/or disjunction of search result sets.