Search broken on Android e.g. title:cat returns unrelated notes

Operating system

Android

Joplin version

3.0.8

What issue do you have?

Search is very slow and returns unrelated results.

A specific reproducible example is title:cat which returns many notes which don't have "cat" anywhere in their title.

The best workaround I found so far is to always add double quotes e.g. "cat" which is much faster and gives much more relevant results.

1 Like

Can you provide some examples (and possibly screenshots) of such notes? I don't really use search on Android, but I've just done some basic testing right now, and title:<term> doesn't seem to return unrelated notes for me here. Testing with Joplin v3.1.2.

Here is the screenshot of an example:

The results are actually identical to "All notes".

The search takes quite a bit of time (I have 10k notes) and the results evolve over several stages (one actually showing correct results) but the final result is the screenshot.

In Configuration => Tools, there's a button "Rebuild search index". Could you try pressing this to see if it makes a difference?

There was a time when the search index could get corrupted on mobile, although normally it shouldn't happen anymore but that would still be worth a try.

Also do you have any error in the log? joplinapp.org/debugging

I tried "fix search index" on my android. Looking at "FTS" keyword in the logs I could see the rebuild completed in 10 minutes and inserted 14k items, deleted 0. However the issue persists.

I will keep looking into logs and try sharing them here.

I looked at errors in the logs and did not find any one related to search.

I don't feel comfortable sharing full logs because I can see sensitive info in them (full name, personal email and joplin cloud inbox email).

Issue persists. I don't know what else to try.

That's very strange. I can say that for me title:something works as expected, but in your case the results are clearly unrelated.

Maybe it's down to the Android version and associated SQLite version. If you go in Configuration => More info. Does it say if FTS is enabled? (it's at the bottom of that screen)

Here is the version info.

Joplin 3.0.8 (prod, android)

Client ID: 13e(...)
Sync Version: 3
Profile Version: 47
Keychain Supported: No

Automatic Backlinks to note: 3.0.3
Embed Search: 2.0.0
Inline tags: 1.3.0
Joplin debug tool: 0.2.0
Quick Links: 1.3.2

Android API level: 30
WebView version: 127.0.6533.103
WebView package: com.google.android.webview
FTS enabled: 1
Hermes enabled: 1

I don't see any issue in there. Just to be sure, could you try disabling all plugins to see if it makes a difference? That would be unlikely that a plugin would interfere with search but worth a try anyway

I disabled plugin support and the issue persists. I deleted all plugins, killed and restarted the app and the issue persists (title:cat search eventually returns unrelated notes).

I was all along using my main device (Boox Tab Ultra).

Interestingly the issue doesn't happen on a similar secondary device (Boox Note 3) with similar configuration and plugins. title:cat returns correct results there.

I could not find a difference which would explain the two behaviors. Any idea welcomed.

Going to bed now, will read your answers tomorrow.

On the problematic device, when I switch to a different profile with only the 5 default "Welcome" notes, search works correctly.

A few months ago I enabled OCR for a while but eventually disabled it weeks ago. Not sure if related.

Documentation says a special custom search mode is automatically enabled when Chinese characters are detected. I do have such characters in some of my 10k notes. But that would not explain why there is no bug on my secondary device with the same dataset.

I have been playing with various searches on my problematic device.

Interestingly, title:pro returns unrelated results (notes without any pro in title) but a few of the notes have title keyword occurrences highlighted in their body.

Why would a title:pro search highlight the title keyword in note bodies?

Maybe the "search as you type" form is to blame, it somehow mixes results of title and title:pro? title:pro results show up quite fast then asynchronously much later the results of title are injected and eventually mess up the final results?

When I type title:cat extremely slowly (several seconds between letters) the bug no longer happens!

This is definitely a bug about the "search as you type" feature which struggles on large datasets. Instead of showing you only the results of the final search title:cat, it somehow mixes in results of partial t, ti, title searches imho instead of cancelling them and ignoring their results.

4 Likes

I wish there was an option to disable search as you type and start the search only when I hit a magnifying glass button or something like that.

Other users with large datasets would agree I guess.

2 Likes

Another suggestion: add the beginning and ending of each search attempt in the logs, together with the full search string e.g. title:cat. It would make understanding what's happening with the search much easier.

I just saw that this issue was opened. Thanks! "search as you type" broken on mobile · Issue #11032 · laurent22/joplin · GitHub

I agree and have the same issue on mobile! Random, unrelated notes pop up during the search, even with a delay, which often causes me to select the appearing right search results, only to get redirected to an unrelated note because the search list gets updated during the selection.
On desktop, a related issue was just fixed (1)