Search matching substring only with '*' appended

DTTG 3.8.7 on macOS 13.2

I have the string “ABC123somemoretext” in an OCR’d PDF. When I search with text:ABC123, this document is not found. It is, though, when I search with text:ABC123*. In that case, the whole string is highlighted, i.e. up to the next space character.

The documentation on Search Inspector says that by default, substrings are found, giving as example that “some” is found in “someone”.

Omitting the “text:” prefix or putting the search string in double quotes doesn’t change anything: Only, if I append the asterisk, is the document found.

Is that the expected behavior? If so, how do I get the “default behavior”, i.e. successful search for substrings?

That is only true if the “Enable operators & wildcards” option is disabled.

That’s not what I’m seeing:

Setting “Enable & wildcards” to off does not help to find the string in question which looks like this when it’s found:

I did press return in the search field whenever I changed the string.

The question actually arose from a script, where I used search like this:
search('text:20221871', {in: ...})
and nothing got found. I also tried adding comparison: "fuzzy", no change. Only after pre- and postfixing the search term with a *, i.e. searching for 'text:*20221871*, the record was found. Again, quotes around the search expression didn’t matter.

If the option is disabled, then it’s a plain search for the exact substring (optionally case insensitive). This means that you have to remove the quotes and the wildcard.

That doesn’t work as announced:

In addition, the options on the right become insensitive at some time. When changing the active database in the sidebar, perhaps. In any case, that causes DT to re-add the asterisk to the search term.

Again: I can see the same issue in a script. Regardless of comparison: "fuzzy", the string is only found when I pre- and postfix it with an asterisk.

This instruction was only intended for the Search inspector. The toolbar search (just like the search AppleScript command) uses always the search syntax (operators & wildcards etc.) and requires either an enclosing asterisk (*word*) or a tilde ( ~word) at the beginning to match substrings.

Thanks for clarifying, and apologies for mixing inspector and toolbar. I suppose there’s a rationale for the different behavior?

The mentioned option is only applied to the inspector to make it easier to search for substrings in the current document like in other apps.