Using Devonthink as a repository for source code and search only on alphanumeric characters is an issue for me

If I understand correctly that the search only works for alphanumeric characters. This is challenging for me because I am using DEVONthink 3 as a repository for source code and a lot of times I would like to search on special characters such as throws -> Int or Result {

I find that I can’t do this.

Any help would be appreciated.

Steven

DEVONthink’s database search doesn’t support this as the alphanumeric search index is always used (e.g. due to the amount of data stored in many databases). The only possible workarounds are to either script this, to use other apps (e.g. EasyFind) or to change the search (e.g. instead of throws -> Int you could use "throws int" or throws BEFORE/2 Int)

@cgrunenberg thanks.

If I could trouble you how could you possibly come up with a search in Devonthink that would find

Result<Data, Error>
or
Result<[Student], Error>

by searching for the Result and Error text but there could be different number of characters between.

Thanks

Maybe you’re better off with a dedicated software development environment? Even emacs has tools for this kind of task, depending on your language of choice. That would probably make it a lot easier to find method definition/usage then trying to coerce DT and it’s string search to do what you want.
Also, if you’re into software development, your probably use a source code control system to keep track of development (think SCCS ore Github). DT has no such functions, afaik.

1 Like

E.g. search for “Result Data Error”. The index-based search is not an exact string comparison, therefore the phrase matches words in that order. The number of spaces or separators between them doesn’t matter.

@chrillek thanks for helping out.

Let me clarify, I don’t wan to use it as a source code control system, for that I use GitHub.

But as I explore and learn new code functionality, I like to be able to keep notes and the code in a manner that when I might need it in the future I have a way of easily finding my notes on how to use that functionality.

In the past, I was using an app called Quiver from Happensapp but it has not been upgraded in a long time and doesn’t have a real functioning iOS app.

I like Devonthink, it keeps all my thoughts and notes I like the idea of having one place where I can access everything.

@cgrunenberg thanks.
As a suggestion I think that would make sense to have the Devonian Times blog , post a series of articles describing and illustrating the search function .

Except for successfully searching for the “special characters”, e.g. the { character, what more do you need to keep notes and all that.

@cgrunenberg

I took your advice and searched "Result [a-z]* Error" and yes it found both Result<Data, Error> and Result<Int, Error> which is what I am looking for.

Problem is it also finds many other files that come back with nothing highlighted. so I am not sure what it thinks is the match. and when I go to search in the file use the search option for a file and put in the search criteria "Result [a-z]* Error" nothing is found.

You could prefix the search string with text: to limit the search to the contents of the files.

You have to enable the operators & wildcards in the Search inspector first, by default it uses a substring search.

1 Like

@rmschne the point is that when searching for code snippets it is useful

I did that and it makes no difference. It is still finding files that their contents don’t match the wildcard pattern.

It is enabled and it does find the search pattern in some of the files that are returned.
What I am saying is that because some of the files being returned by the search/find should not be returned because they don’t contain the search wild card pattern and that is the reason it is not being found in the search inspector pane.

So the bottom line is that the search is returning files that do not contain in its contents the search pattern that I noted above.

Thanks

@BLUEFROG
I am just bumping this. Need help in the fact that the wildcard search that I am doing is bringing back files that don’t match.

Can you post screencaps of this?

Plus a zipped file that shouldn’t be found.

Here is the search text:"Result [a-z]* Error" and the returned files.

The match in the first file is highlighted

The second file found does not contain a match

and nothing is highlighted

placeholder-m-2.md.zip (939 Bytes)

Thank you, we’ll investigate this.

Is this still being looked into?

Yes, it’s a known and rare but complicated issue but the next release won’t fix this yet.