Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: Thu, 30 Jul 2009 22:06:16 +0200

====== Search ======
Created Thursday 30 July 2009

* search should be able to find orphaned pages
* idem for non-existent pages (linked but non existing)
* allow search query for all backlinks to a namespace recursively (tags plugin)

Once we have support for complex search queries we should use this to define selections of pages. These are basically saved searches. E.g. "all pages linked by ":index" or "all pages linking to :tag:favourite".

* We can use selections to define a group of pages for export.
* We can use selections to filer in the TODOList dialog.

Typical use cases:
* Look for pages matching a word
* Look for page matching a word in a certain namespace
* Look for back links

Advanced use cases
* Look for pages that are not linked from anywhere
* Look for dead links

Since we also want to use search queries to collect pages for export it also makes sense to be able to list all pages linked by a certain page.

===== Syntax =====

See Usage:Searching for query syntax description.

Inspiration for syntax from http://xesam.org/main/XesamUserSearchLanguage

Main points are:
* Be easy and simple to use
* Any Google-like search should do the expected
* Don't cater for complex queries (hence sub-queries/braces are left out)

So just 3 logical ops: AND, OR and NOT and some aliases (and, &&, +, or, ||, -). No grouping or sub-queries and only one quoting style. Only difference is that we need a space after a field selector because page names can also contain ":". 

For the average user the complexity allow by the current syntax will be more than enough.

===== Suggestions =====
* Use proximity to set ranking (e.g. all terms less than 20 words apart and less than 50 words apart) 

