Home / GitHub Page

How to bring or enable type-ahead search

Hi,

I want to bring or enable type-ahead search in Joplin to search the contents inside the body

To search inside the body i.e all nodes, we can type body:searchword

How to bring or enable type-ahead search? Hope it is supported by Joplin

Thanks.

Type-ahead is supported in both local search (within a note) and global search (across all notes). What’s not working for you?

How to do a type-ahead search ? It is not working by default.

Do we need to enable any checkbox or setting to support type-ahead

Can you please attach a gif image how to do it?

1 Like

This will only search the heading or inside contents as well…

for example, few has the search mechanism as follows

title:search -> searched inside the titles only
body:search -> search inside the contents as well i.e full text search

Please let me know whether Joplin supports both or title only

@bjc, when you click on the Search field, there’s a “Usage” links that popups where you can read about what’s supported or not. Have you tried clicking on this link?

on my side , when I click on the link “usage” ; it tries to start the browser but failed as it’s already started.
normal ?

I understand the title and body search…However the link says https://www.sqlite.org/fts3.html#simple_fts_queries and https://www.sqlite.org/fts3.html#full_text_index_queries are supported. But not sure how to use those queries in the search bar.

Can you please let me know few queries which would work in the search bar of type simple fts and full text index queries???

The problem is how to locate the tables? What would be the table name? Can we query the notes with like and other operators similar to DB query

This doesn’t work by default in windows 10. Do i need to do anything? Basically i want to do a type-ahead search with search inside the body

When i did body:start typing the word…it doesn’t work

No there is no extra setting. I can’t reproduce this, because I have no Windows. But the code is the same, so I’m not sure what’s up with that.

I think the issue is that Joplin doesn’t do a partial match with an asterisk (*). In your example you had types “tes” and nothing showed up until you completed by typing “test”. I think @bjc would like matches for “test” to show up after typing “tes” (equivalent of typing “tes*”).

@laurent, If I made a pull request for a setting that would automatically append an * to searches would you accept it? I think the searching is fast enough that most users would benefit from this, and those that don’t would simply be able to turn it off.

This is problematic. What if I only wanted notes that included the word tes? If you were to add an asterisk by default, this would no longer be possible.
Unless we make sure that all results with the word tes are really the first ones in the result. Are they?

I think do to the sorting whole matches should usually rank higher (I quick test confirmed this). But I see your point, I wonder if there is an elegant solution to only allow this on typeahead, but after a brief delay you would only get exact matches. I’ll think about it.

Yes I’d like if we could get rid of the asterisk, but we’d need to do so without losing control of the search results.

Currently the query format follows closely FTS4, but perhaps we can have a more user friendly format, then transform it to FTS4 before sending it to Sqlite.