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 missing feature
46
47You can filter bugs based on the absence of something.
48
49| Qualifier  | Example                                |
50| ---        | ---                                    |
51| `no:label` | `no:label` matches bugs with no labels |
52
53## Sorting
54
55You 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.
56
57Note: 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)
58
59### Sort by Id
60
61| Qualifier                  | Example                                              |
62| ---                        | ---                                                  |
63| `sort:id-desc`             | `sor:id-desc` will sort bugs by their descending Ids |
64| `sort:id` or `sort:id-asc` | `sor:id` will sort bugs by their ascending Ids       |
65
66### Sort by Creation time
67
68You can sort bugs by their creation time.
69
70| Qualifier                               | Example                                                            |
71| ---                                     | ---                                                                |
72| `sort:creation` or `sort:creation-desc` | `sor:creation` will sort bugs by their descending creation time    |
73| `sort:creation-asc`                     | `sor:creation-asc` will sort bugs by their ascending creation time |
74
75### Sort by Edit time
76
77You can sort bugs by their edit time.
78
79| Qualifier                       | Example                                                            |
80| ---                             | ---                                                                |
81| `sort:edit` or `sort:edit-desc` | `sor:edit` will sort bugs by their descending last edition time    |
82| `sort:edit-asc`                 | `sor:edit-asc` will sort bugs by their ascending last edition time |