queries.md

 1# Searching bugs
 2
 3You can search bugs using a micro query language for both filtering and sorting. A query could look like this:
 4
 5```
 6status:open sort:edit
 7```
 8
 9A few tips:
10
11- queries are case insensitive.
12- you can combine as many qualifiers as you want.
13- you can use double quotes for multi-word search terms. For example, `author:"René Descartes"` searches for bugs opened by René Descartes, whereas `author:René Descartes` will throw an error since full-text search is not yet supported.
14
15
16## Filtering
17
18### Filtering by status
19
20You can filter bugs based on their status.
21
22| Qualifier       | Example                             |
23| ---             | ---                                 |
24| `status:open`   | `status:open` matches open bugs     |
25| `status:closed` | `status:closed` matches closed bugs |
26
27### Filtering by author
28
29You can filter based on the person who opened the bug.
30
31| Qualifier      | Example                                                                          |
32| ---            | ---                                                                              |
33| `author:QUERY` | `author:descartes` matches bugs opened by `René Descartes` or `Robert Descartes` |
34|                | `author:"rené descartes"` matches bugs opened by `René Descartes`                |
35
36### Filtering by label
37
38You can filter based on the bug's label.
39
40| Qualifier     | Example                                                                   |
41| ---           | ---                                                                       |
42| `label:LABEL` | `label:prod` matches bugs with the label `prod`                           |
43|               | `label:"Good first issue"` matches bugs with the label `Good first issue` |
44
45### Filtering by title
46
47You can filter based on the bug's title.
48
49| Qualifier     | Example                                                                        |
50| ---           | ---                                                                            |
51| `title:TITLE` | `title:Critical` matches bugs with a title containing `Critical`               |
52|               | `title:"Typo in string"` matches bugs with a title containing `Typo in string` |
53
54
55### Filtering by missing feature
56
57You can filter bugs based on the absence of something.
58
59| Qualifier  | Example                                |
60| ---        | ---                                    |
61| `no:label` | `no:label` matches bugs with no labels |
62
63## Sorting
64
65You can sort results by adding a `sort:` qualifier to your query. “Descending” means most recent time or largest ID first, whereas “Ascending” means oldest time or smallest ID first.
66
67Note: to deal with differently-set clocks on distributed computers, `git-bug` uses a logical clock internally rather than timestamps to order bug changes over time. That means that the timestamps recorded might not match the returned ordering. More on that in [the documentation](model.md#you-cant-rely-on-the-time-provided-by-other-people-their-clock-might-by-off-for-anything-other-than-just-display)
68
69### Sort by Id
70
71| Qualifier                  | Example                                              |
72| ---                        | ---                                                  |
73| `sort:id-desc`             | `sor:id-desc` will sort bugs by their descending Ids |
74| `sort:id` or `sort:id-asc` | `sor:id` will sort bugs by their ascending Ids       |
75
76### Sort by Creation time
77
78You can sort bugs by their creation time.
79
80| Qualifier                               | Example                                                            |
81| ---                                     | ---                                                                |
82| `sort:creation` or `sort:creation-desc` | `sor:creation` will sort bugs by their descending creation time    |
83| `sort:creation-asc`                     | `sor:creation-asc` will sort bugs by their ascending creation time |
84
85### Sort by Edit time
86
87You can sort bugs by their edit time.
88
89| Qualifier                       | Example                                                            |
90| ---                             | ---                                                                |
91| `sort:edit` or `sort:edit-desc` | `sor:edit` will sort bugs by their descending last edition time    |
92| `sort:edit-asc`                 | `sor:edit-asc` will sort bugs by their ascending last edition time |