From 8a0f1857810977d8da3753a9b65641c778547548 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 20 Aug 2020 13:56:36 +0200 Subject: [PATCH] start changes for m44 --- Attributes.md | 12 ++++++------ Search.md | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Attributes.md b/Attributes.md index 5d030e2..526e0e7 100644 --- a/Attributes.md +++ b/Attributes.md @@ -6,14 +6,14 @@ There are four types of attributes: * Relation - specifies named relation (link) to another note * Label and relation definition - these are described in [[Promoted attributes]] page -Sometimes we're talking about labels and relations - keep in mind that both of them are types of attributes and are very similar. +Sometimes we're talking about labels and relations - keep in mind that both of them are types of attributes. [[images/attributes.png]] ## Labels Labels are used for several things: -* user can use them as labels with optional value - e.g. when catalogizing books, you might add labels like @year=1999, @genre=sci-fi, @author=Neal Stephenson +* user can use them as labels with optional value - e.g. when catalogizing books, you might add labels like @year=1999, @genre=sci-fi, @author="Neal Stephenson" * attributes can be used to configure some advanced features / settings - see below * plugins / scripts can use these to mark notes with some special values / metadata (e.g. [[Weight Tracker]] will have "weight" attribute on [[day notes]] based on whose it can create chart). @@ -45,9 +45,9 @@ Following labels are used for advanced configuration: ## Relations Relation is a kind of link between two notes. -This could be used when you e.g. keep a people database, you can use relations to keep formal links between people - e.g. note "Mike" will have relation "is husband of" note "Kate". +This could be used when you e.g. keep a book database, you can use relations to keep formal links between the book (note) and the book's author (note) by defining an "author" relation on the book note pointing to the author's note. -More importantly relations are used for some more advanced things - like attaching scripts to events happening on certain note. +Relations are used also for some advanced scripting - like attaching scripts to events happening on certain note. ### Standard relations @@ -66,8 +66,8 @@ Other relations: ## Multiplicity -Attributes allow multiplicity - there can be multiple attributes with the same name. We're then calling such attributes "multivalue". +Attributes allow multiplicity - there can be multiple attributes with the same name. We're then calling such attributes "multi valued". ## Attribute inheritance -See [[Attribute inheritance]]. \ No newline at end of file +See [[Attribute inheritance]]. diff --git a/Search.md b/Search.md index 1d4cec1..dab5ed6 100644 --- a/Search.md +++ b/Search.md @@ -13,11 +13,11 @@ You can activate search by clicking on magnifier icon on the left or pressing `C ## Fulltext -Fulltext search is triggered whenever search string doesn't start with `@` (used in attribute search) or `=` (saved search with script). +Fulltext search is triggered whenever search string doesn't start with `#` (used in attribute search). Fulltext searches on both title and content of undeleted, unprotected text and code notes which are not [[archived|archived notes]]. -Input string is tokenized by whitespace separators and each individual token (word) must be present in the title or content. If you don't want this automatic tokenization, you can surround your search with double quotes, e.g. `"hello world"` will search for exact match. +Input string is tokenized by whitespace separators and each individual token (word) must be present in the title, content or note's attributes. If you don't want this automatic tokenization, you can surround your search with double quotes, e.g. `"hello world"` will search for exact match. ## Attribute query syntax @@ -25,18 +25,18 @@ Input string is tokenized by whitespace separators and each individual token (wo Here you query by standard [[attributes]]: -* `@abc` - returns notes with label abc -* `@!abc` - returns notes which don't have label abc -* `@year=2019` - matches notes with label `year` having value `2019` -* `@year!=2019` - matches notes with label `year`, but not having value 2019 or not having label `year` at all. - * if you want to express condition that note must have `year` label, but not value 2019, then you can do that with `@year @year!=2019` -* `@year<=2000` - return notes with label `year` having value 2000 or smaller. `>`, `<`, `>=` and `<=` are supported. +* `#abc` - returns notes with label abc. `~abc` will look for notes with relation abc. +* `#!abc` - returns notes which don't have label abc +* `#year = 2019` - matches notes with label `year` having value `2019` +* `#year != 2019` - matches notes with label `year`, but not having value 2019 or not having label `year` at all. + * if you want to express condition that note must have `year` label, but not value 2019, then you can do that with `#year #year != 2019` +* `#year <= 2000` - return notes with label `year` having value 2000 or smaller. `>`, `<`, `>=` and `<=` are supported. * In this case parameter can be parsed as a number so number-wise comparison is done. But it's also possible to compare strings lexicographically in the same way. This is useful for comparing dates as seen below. -* `@rock @pop` - matches notes which have both `rock` and `pop` labels - * `@rock and @pop` is an alternative syntax for the same thing -* `@rock or @pop` - only one of the labels must be present +* `#rock #pop` - matches notes which have both `rock` and `pop` labels + * `#rock and #pop` is an alternative syntax for the same thing +* `#rock or #pop` - only one of the labels must be present * `and` has a precedence over `or` in case both operators are used in a search string -* `@frontMan=*John` - matches notes where `frontMan` label starts with "John". There's also `!=*` for "doesn't start with", `*=` for "ends with" and `!*=` for "does not end with", `*=*` for "contains" and `!*=*` for "does not contain" +* `#frontMan =* John` - matches notes where `frontMan` label starts with "John". There's also `*=` for "ends with" and `*=*` for "contains". ### Virtual attributes @@ -50,7 +50,7 @@ It's also possible to query by so called "virtual attributes": * `isProtected` - 1 if the note is protected, 0 otherwise * `title` - useful if you want to search title separately * `content` -* `type` - `text`, `code`, `image`, `file`, `search` or `relation-map` +* `type` - `text`, `code`, `image`, `file`, `book`, `search` or `relation-map` * `mime` - e.g. `text/html` for text note * `text` - fulltext attribute of both title and content together * For example `@text*=*Hello`. So that you can combine searching for both text and attributes. @@ -107,4 +107,4 @@ Opening Trilium like in the example below will open search pane and automaticall ``` http://localhost:8080/#search=abc -``` \ No newline at end of file +```