Creating replicants of search results for further filtering/work

I found myself badly needing the ability to search for a particular string of text, which it turns out is impossible to do in DEVONthink. To wit, I need to find everything that contains the text “[TABLE]”, and I learned today that’s a no-no on two counts:

  1. DT does not support searching for special characters like ‘[’ and ‘]’ because it indexes only alphanumeric characters if I understand correctly (that search will actually find a gazillion records because it treats the word ‘TABLE’ as a character class).
  2. Arguably worse, there is no way to do a case-sensitive search in DT. I can hardly believe this, seeing how important it often is to be able to distinguish capitalized versions of a word from its more common lower/mixed-case versions in computing.

As such, I seem to be stuck with only fallback options. Like searching for the word “TABLE” and then saving those results somehow to prune them later. Forgive me if there’s an obvious way to do this, but I’m venturing outside my comfort zone in this task. I thought maybe I could use replicants as those seemed promising. I created a fresh database to hold my search results, added a group named “Import Cleanup” and performed a search. I saw I could easily right-click my 436 results and choose the option to create replicants, only when I selected the recently created group, DT just beeped at me and did nothing.

I don’t know why it’s failing to do that as I find I can Cmd + Option + drag those selected search items onto the newly created group and create replicants just fine. So I’m off to the races after all it seems. My question is this: is there some better way to complete my task? I essentially need to weed out all the false positives from the search, then edit the resulting items across all my databases one at a time to fix up the places were tables could not be imported from the original OneNote files that spawned the content. Thanks in advance for any thoughts folks might have.

UPDATE: Scratch that. Even though the cursor seemed to indicate I would be creating replicants of the things in my databases, it appears I was actually copying those 436 items. Nuts. Bottom line: I would still appreciate any suggestions as to how to accomplish my task. Thanks!

Actually not that often, at least we got very few requests of this kind during the last decades.

Are the search results and the group all located in the same database? Otherwise replicating isn’t possible.

What about AppleScript? Perform a search for text:table first, then check for each result whether its plain text property contains “[TABLE]”.

I’m genuinely surprised at the lack of requests for case-sensitive searching. That’s something I often need to do. As to the search results, they’re across 17 different imported databases, so there’s really no good way to do that all at once but in a separate database. I suppose I could perform the same task 17 different times, confining myself each time to a particular database. That’s one option. The AppleScript, by which I assume you mean JavaScript in the Apple Script Editor, idea is an interesting one. I might try that just for the practice.

Perhaps there’s a simpler approach: is there any way to export the search results? I could just dump that data into something and whittle it down from there.

I suspect it would slow down the speed of DT’s search notably - with few benefits.

What would be some examples where case-sensitive searching is important? I can think of numerous examples where it would be undesirable and likely cause me to miss important hits.

1 Like

No. But you could save the search as a global smart group (and optionally search in this smart group afterwards).

I’m genuinely surprised at the lack of requests for case-sensitive searching. That’s something I often need to do.

As asked by @rkaplan, in what instances would this be needed? Context generally provides enough information to alleviate the need for case.

Yeah, the problem with the smart group approach is that I’ve got records in my result (due to the lack of case-sensitive searching) that I don’t need to process. I’d like to be able to whittle this task down a few at a time, and to my knowledge there’s no way to make a record stop showing up in a smart group based on a search.

Anytime you’re searching for an acronym or technical term or… essentially the stuff I do all the time. Were I to search through my notes for links related to the 2020 election looking for “MAGA”, for example, it’s going to find every instance of every other word that contains the lowercase letters as well. Whole word and case sensitive searching are the two most important such options short of needing regular expressions.

It might help to assign a computing tag to all documents on that topic. This would filter out documents about dining tables or table tennis.

You did not mention how you organize your documents. As a general rule, if you spend less time categorizing your stuff, you would spend more processing search results.

1 Like

I don’t much use tags, and that’s on me. I certainly agree that they would make a number of things easier. I intend to start using them more but have had bigger DT-fish to fry over these last couple years. In this particular instance, however, I don’t think it would help me at all because the need to process these records stems from importing 17 different OneNote notebooks from the last 20+ years. I don’t have any good way to auto-tag things through that import pipeline without writing custom scripts. But maybe that’s an option I should consider at this point.

:thinking:

The substring is not matched here. Nor is it matched in a PDF of the same file…

I find substrings matched all the time. Like just now I search for “refrig” and find all my articles on refrigerators. What am I missing?

A screen capture would be helpful.

You just want to find “refrig”? Could it be that you don’t press space after “refrig”? Then “refrigerators” will also be found, no?

  1. You surely have Partial matches while typing enabled in the search options under the magnifying glass.

  2. You have an uncommitted search, as evidenced by the presence of the cursor in the search field. In combination with the partial matches open, there is an implicit wildcard at the end of the last search term, in this case it’s refrig*. Pressing Return to commit the search will remove the wildcard.

  3. Are you intentionally not using a search prefix? You should be as specific as possible when searching. See…

1 Like

Regarding (1), maybe so. I haven’t changed any default options. I didn’t even know there was an option. Regarding (2), also maybe so. Again, I didn’t know it was an option. Regarding (3), I did know there was an ability to search by prefix, but it doesn’t really do me any good when all my documents are markdown–unless I’m missing something?

More importantly, none of that counts against either the value of searching by whole word or case sensitive. If I can’t search for a literal text string like “[TABLE]”, the ability to find it by whole word and case sensitive would be very handy.