From da92a19b54c930dc61a8102277bd8623d46c9491 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 22 Feb 2020 11:19:53 +0100 Subject: [PATCH] Update the README --- README.md | 12 ++++++++++-- app.lua | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 70292d6..ee8b94b 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,17 @@ TODO document custom domain support _BlobPad_ supports full-text searching with a custom query language: -Sample queries: +### Query language + + - `+query`/`-query`: will match a note only if it matches/does not matches the query term + - `"query"`: will match the query term exactly/requires an exact match (even in the middle of word) + - `query`: the query term will be stemmed and matched with the note "text index" + +### Sample queries - `+apple -orange`: returns notes containing `apple` **and** does not contain `orange` - `apple`: will match notes containing `apple` and `apples` - - `apple orange`: will match notes containg `apple(s)` **or** `orange(s)` - `"apple"`: will match only `apple` (i.e. not `apples`), and will also match `pineapple` + - `apple orange`: will match notes containg `apple(s)` **or** `orange(s)` + - `apple orange -"pineapple"`: will match notes containing `apple(s)` **or** `orange(s)`; **and** that does not contains `pineapple` + - `"multiple words"`: will match notes containing exactly `multiple words` diff --git a/app.lua b/app.lua index 3a8e357..a753166 100644 --- a/app.lua +++ b/app.lua @@ -64,7 +64,7 @@ router:get('/', function(params) -- most recently updated first local sort_index = '-_updated' - if qs == "" then + if qs == '' then local docs, pointers, _, _ = col:query('', 50, function(doc) return doc.pinned end, sort_index) for _, d in ipairs(docs) do _expand_note(d, pointers, 800, true) -- 2.45.2