Changes between Version 60 and Version 61 of TracQuery
- Timestamp:
- May 27, 2022, 7:11:08 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracQuery
v60 v61 68 68 == Query Language 69 69 70 The `query:` TracLinks and the [TicketQuery "[[TicketQuery]]"] macro both use a mini “query language” for specifying query filters. Filters are separated by ampersands (`&`) .Each filter consists of the ticket field name, an operator and one or more values. Multiple values are separated using a pipe (`|`), meaning the filter matches any of the values. To include a literal `&` or `|` in a value, escape the character with a backslash (`\`).70 The `query:` TracLinks and the [TicketQuery "[[TicketQuery]]"] macro both use a mini “query language” for specifying query filters. Filters are separated by ampersands (`&`), the `[[TicketQuery]]` macro additionally also accepts commas (`,`). Each filter consists of the ticket field name, an operator and one or more values. Multiple values are separated using a pipe (`|`), meaning the filter matches any of the values. To include a literal `&` or `|` in a value, escape the character with a backslash (`\`). 71 71 72 72 The available operators are: … … 82 82 || '''`!$=`''' || the field content does not end with any of the values || 83 83 84 Filters combining matches and negated matches can be constructed for text fields such as Keywords and CC using the //contains// (`~=`) operator. The `-` operator is used to negate a match and double quotes (//since 1.2.1//) are used for whitespace-separated words in a phrase. For example, `keywords~=word1 word2 -word3 "word4 word5"` matches tickets containing `word1` and `word2`, not `word3` and also `word4 word5`. 84 Filters combining matches matches can be constructed for text fields such as Keywords and CC using the //contains// (`~=`) operator. 85 The `!` operator is used to negate a match. 86 87 Note that for `query:` the match operator `=` needs to be on first position when combined with other operators, for example `=!` or `=~`. The `[[TicketQuery]]` macro on the other side accepts both syntax variants, for example `!=` or `~=` as well as `=!` or `=~`. 88 89 Double quotes (//since Trac 1.2.1//) are used for whitespace-separated words in a phrase. For example, `keywords~=word1 word2 -word3 "word4 word5"` matches tickets containing `word1` and `word2`, not `word3` and also `word4 word5`. 90 85 91 || '''`status=closed,keywords~=firefox`''' || query closed tickets that contain keyword `firefox` || 86 92 || '''`status=closed,keywords~=opera`''' || query closed tickets that contain keyword `opera` ||