Notes/Notebook/Tag/Task: Filtering and Searching

what do you think about such a proposal ?

Inside the exising search field, we could enter

:date 
:-date (for descending)
:tag
:-tag
:task
:-taks
:location
:-location
:tsize 
:-tsize

to sort by one of that value, below is a proposal of the layout resulting from that choosen sort

Notes list :

layout of sort by date :

could it be displayed like

Today             v

* [ ] note title2
 tag1 tag2
 
* note tile3
 tag3 tag4

yesterday       v

* [ ] note title1
  tag1 tag2

01/01/2018      v

* note title999
  tag1 tag2

where tag1 and tag2 could be display each with their own color

sort by tag : (but not filter by tag)

Tag1             v

* note title2
 tag1 tag2

Tag2 

* note title2
 tag1 tag2

* note tile3
 tag2 tag4

Tag 3       v

* note title999
  tag3

sort by tag with the biggest number of notes (:tsize / :-tsize)

Tag3 (125)        v

* note title2
 tag1 tag2
[...]

Tag2 (12) 

* note title2
 tag1 tag2

[...]

Tag 1 (2)      v

* note title999
  tag3
[...]

sort by tasks done / undone / due

Undone             v

* [ ] note title1
 tag1 tag2

Due                   v

* [ ] note title2
   tag1 tag2
   due date : 01/01/2018

* [ ]note tile3
  tag2 tag4
  due date : 11/101/2017

Done              v

* [x] note title999
  tag3

sort by location

Town1             v

* [ ] note title1
 tag1 tag2

Town2                  v

* [ ] note title2
   tag1 tag2
   due date : 01/01/2018

* [ ]note tile3
  tag2 tag4
  due date : 11/101/2017

Town3              v

* [x] note title999
  tag3

sort by folder

Folder1             v

* [ ] note title1
 tag1 tag2

* [ ] note title2
   tag1 tag2
   due date : 01/01/2018

* [ ]note tile3
  tag2 tag4
  due date : 11/101/2017

Folder2              v

* [x] note title999
  tag3

folders list

always in the serach field, enter the choosen order, eg:

:folder
:-folder (for descending)
:fsize
:-fsize

sort by number of notes in folder

FolderX (1534) 
FolderB (153) 
FolderF (15) 
FolderE (5) 

sort by name (default)

FolderB (153) 
FolderF (15) 
FolderE (5) 
FolderX (1534) 

Searching:

in the same search field explain above, we could enter:

:title foobar

get the notes with title containing foobar

:body foobar

get the notes with body containing foobar

:body foo; -body bar

get the notes with body containing foo but without bar

:all foobar

get the notes with title + body containing foobar

:all foo; all:-bar

get the notes with title + body containing foo but without bar

:date 01/01/2018

get notes of that day (useful when my notes list is one kilometer long :slight_smile:

:date 01/01/2018 to 01/02/2018

get notes between those 2 days

then we can combine all of them

:date 01/01/2018 :all foo;-bar :folder Home

I want to get the notes for that day with title and body containg foo and not bar, located in the Home folder

10 Likes

I like the idea in principle. From a syntax standpoint, I’m personally used to the way Gmail does it. Colon goes after the field being searched and uses the minus on the term not wanted. Example title:foo body:-bar. This isn’t that different, just thinking it could helpful to leverage what maybe a lot of people have potentially been exposed to?

Otherwise, I like it.

1 Like

my issue about it

For the Searching part, I’m indeed thinking of doing something similar, except that “:title foobar” will be “title:foobar”. I’m actually thinking of copying StackOverflow’ spec which as often is pretty good.

For the filtering, I didn’t completely understand. Do you mean we should type how we want to sort in the search field? I’d rather extend the existing sorting options (in the desktop app, in View -> Sort Notes by), or am I missing something?

No I meant for example : I want all notes talking about food but without cake.

something like

:Body food :body -cake

Filtering is to reduce the result of a given research

Ah yes, I’m indeed hoping to support that kind of syntax at some point. Not in the coming search engine (which syntax will be purely based on SQLite FTS) but in a future release.

3 Likes

Hello, thanks for this excellent App! I think I have remarked a small problem: it seems that since the latest update (Version 1.0.118 for Mac), it is no longer possible to search in note titles, only in note bodies. Any ideas? Thanks!

Do you have an example? For example, the search query you tried and the note titles you expected to find?

Here’s an example: a note with the title “Weihnachtsgeschenke kaufen” (buy christmas gifts) is not found in the query; however, when I search for a word in the text body of the same note, it’s immediately displayed.
49

You either need to search for the full word, or to do a prefix search with Weihnacht*. The documentation explains the various queries that are possible.

1 Like

I understand. Sorry! Thanks a lot, problem solved.

I was searching on how to filter search results by date and stumbled on this post. As far as I understand, this is still not possible, right?

I think this would be a fantastic feature to have. I am not a pro developer by far, but am very interested in getting this feature and would love to help to the best of my ability. To anyone reading, my questions are:

  • How hard do you anticipate this to be?
  • How would you approach building this feature, or at least starting to build?
  • Would it make sense to research in solutions similar to Algolia (Search-as-a-Service, free for open-source)?

Thanks for the input. Have a wonderful day!

Yes, the feature is still not possible. This feature was given as a GSOC Idea. And I'm planning to apply for this topic.

It's gonna be somewhat tricky and would require quite some refactoring, I guess. The current search engine works on SQLite Full Text Search (FTS) which doesn't cover a lot of use cases that Joplin users have. It also doesn't have a way to filter results inherently.

I'm still researching on how to approach building this feature. So, I will update here once I have a concrete plan for it.

It wouldn't make sense because Algolia (or any other Search-as-a-Service) would require that the user's notes be indexed on their servers. It would also require that the user have internet connection everytime they have to search their notes, which totally doesn't make sense in our use case.

could be an option but rather a gimmick than a core feature as Joplin focus on privacy.
An option is to have it implemented in group-ware when used, e.g. nextcloud Search - App Store - Nextcloud

1 Like

I would like to use filters in Joplin: Using tags as filter inside a notebook :label: :bookmark_tabs:

For example, errands notebook used with grocery tag or online store tag.

Expected steps to use :

  1. select one notebook with mouse
  2. select one or more tags with mouse and Ctrl key.
    Result : only the notes with selected tags appear in the notebook

Or for the same use an API Endpoint to deal with query search, suggested by @foxmask

4 Likes