zim-desktop-wiki / zim-desktop-wiki

Main repository of the zim desktop wiki project
http://zim-wiki.org
GNU General Public License v2.0
1.93k stars 369 forks source link

Always search (indexed) tags #2681

Open maltfield opened 2 weeks ago

maltfield commented 2 weeks ago

This ticket is a feature request for zim searches to always first search indexed tags with the query, before it searches the Page contents.

Problem

Searching in Zim is, in general, slow.

To try to make a page appear faster, I've gotten into the habit of adding a "Keywords" section to the top of all my zim Pages. For example, for a Page titled "Git Hub", I may add the following line to the top of the Page (in hopes that this would make Zim find it faster)

keywords: git git git git hub git hub git hub github github github git lab git lab git lab gitlab gitlab  gitlab vcs vcs vcs version control

....but that doesn't work at all.

I've also recently learned about tags, which are indexed. This means I can put the following at the top of a given Page

tags: @git @github @git_hub @gitlab @git_lab @vcs @version_control

This works great if I search for @git, but this does not work if I search for git or if I search for version control. This is what I'd like to fix.

Solution

Searching in Zim for a keyword that is part of the article title is fast (because it's indexed). Tags are indexed.

The solution to this problem is two-fold:

  1. Zim should search Page's indexed tags for all the keywords in a user's search query, and
  2. Zim should search for multiple-word queries in underscore-delimited tags

Such that:

  1. If a user searches for git (without the @ prefix), then it very quickly returns any pages with the @git tag, and
  2. If a user searches for version control (without the @ prefix and with a space between the words), then it very quickly returns any pages with the @version_control tag

Why?

This would empower users to quickly adjust the index for those queries that they keep typing that take forever to return the page that they want. Workflow would be:

  1. User notices that every time they search for version control, it takes 30-60+ seconds to find the page that they want
  2. User realizes that they search for version control several times per week, and they want to speed up the results for this specific page being returned for this specific query
  3. User adds the text @version_control to somewhere in the Page that they want to find faster
  4. User updates index
  5. User searches for version control, and the page they want appears in the results almost instantly
maltfield commented 2 weeks ago

See also: