Odd searching issue when searching for text

Bug report

When using ‘Search All’ to find a specific search term (specifically the word ‘Preference’) was not found the required note. Other search terms I tested that were in the same note did not have an issue. I tested many when I discovered this, and all others worked as expected. I have concerns that this might lead to further failed searches in future.

I am otherwise enjoying InkDrop while trialing.

Environment

Desktop:

  • Platform: Windows 11
  • Platform version: 23H2
  • App Version: 5.7.0

Same behavior on mobile:

  • Platform: iOS
  • Platform version: 17.3.1
  • App Version: v5.2.0 (116)

How to reproduce

The following text in any notes, is not found when searching all notes for the terms ‘Preference’. Text case has no impact.
Searching for ‘IfPreference’ will return the note and highlight both instances below. But remove ‘IfPreference’ from the note, and no result is returned. Searching for ‘WhatIfPreference’ works fine.

It does not make a difference if the text is plain text, or in a code block.

if (!$WhatIfPreference) {}

IfPreference

Hey,
I think that the behavior you described is expected.

Here you can find more information about the current search algorithm:

Hi Daniel,

Thanks for the feedback.
Yes, as Lukas pointed out, Inkdrop currently uses porter stemming algorithm in its full-text search, which doesn’t work like grep. Specifically, it doesn’t support middle-letter matching by design.

But I understand it’s not perfect for searching those tech notes like your case. I’ve been wanting to switch to another algorithm that could support partial matches without losing the performance.

Today, I researched again, and found that SQLite’s FTS5 now officially supports trigram!!!
I remember that it wasn’t available when implementing the search feature. Great news.
One drawback is that you are no longer able to search with words less than three characters.
But worth trying it.

1 Like

UPDATE:

Okay, I came up with a workaround for supporting searching with one/two-character words in trigram while maintaining the performance. Pretty excited.

1 Like

Alright this is so good! The UI will be improved

1 Like

Okay, it can properly find a note with a code fragment like "er } = require(":

3 Likes

This is exciting! I always have issue searching for partial code snippets using the current search.

When do you think this feature will be completed?

I’m about to release the beta version. Hold on! @taichi

1 Like

@taichi It’s out!

1 Like