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- instead of a complete ID, you can use any prefix length. For example `participant=9ed1a`.
 15
 16
 17## Filtering
 18
 19### Filtering by status
 20
 21You can filter bugs based on their status.
 22
 23| Qualifier       | Example                             |
 24| ---             | ---                                 |
 25| `status:open`   | `status:open` matches open bugs     |
 26| `status:closed` | `status:closed` matches closed bugs |
 27
 28### Filtering by author
 29
 30You can filter based on the person who opened the bug.
 31
 32| Qualifier      | Example                                                                          |
 33| ---            | ---                                                                              |
 34| `author:QUERY` | `author:descartes` matches bugs opened by `René Descartes` or `Robert Descartes` |
 35|                | `author:"rené descartes"` matches bugs opened by `René Descartes`                |
 36
 37### Filtering by participant
 38
 39You can filter based on the person who participated in any activity related to the bug (Opened bug or added a comment).
 40
 41| Qualifier           | Example                                                                                            |
 42| ---                 | ---                                                                                                |
 43| `participant:QUERY` | `participant:descartes` matches bugs opened or commented by `René Descartes` or `Robert Descartes` |
 44|                     | `participant:"rené descartes"` matches bugs opened or commented by `René Descartes`                |
 45
 46### Filtering by actor
 47
 48You can filter based on the person who interacted with the bug.
 49
 50| Qualifier     | Example                                                                         |
 51| ---           | ---                                                                             |
 52| `actor:QUERY` | `actor:descartes` matches bugs edited by `René Descartes` or `Robert Descartes` |
 53|               | `actor:"rené descartes"` matches bugs edited by `René Descartes`                |
 54| `
 55
 56**NOTE**: interaction with bugs include: opening the bug, adding comments, adding/removing labels etc...
 57
 58### Filtering by label
 59
 60You can filter based on the bug's label.
 61
 62| Qualifier     | Example                                                                   |
 63| ---           | ---                                                                       |
 64| `label:LABEL` | `label:prod` matches bugs with the label `prod`                           |
 65|               | `label:"Good first issue"` matches bugs with the label `Good first issue` |
 66
 67### Filtering by title
 68
 69You can filter based on the bug's title.
 70
 71| Qualifier     | Example                                                                        |
 72| ---           | ---                                                                            |
 73| `title:TITLE` | `title:Critical` matches bugs with a title containing `Critical`               |
 74|               | `title:"Typo in string"` matches bugs with a title containing `Typo in string` |
 75
 76
 77### Filtering by missing feature
 78
 79You can filter bugs based on the absence of something.
 80
 81| Qualifier  | Example                                |
 82| ---        | ---                                    |
 83| `no:label` | `no:label` matches bugs with no labels |
 84
 85## Sorting
 86
 87You 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.
 88
 89Note: 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)
 90
 91### Sort by Id
 92
 93| Qualifier                  | Example                                              |
 94| ---                        | ---                                                  |
 95| `sort:id-desc`             | `sort:id-desc` will sort bugs by their descending Ids |
 96| `sort:id` or `sort:id-asc` | `sort:id` will sort bugs by their ascending Ids       |
 97
 98### Sort by Creation time
 99
100You can sort bugs by their creation time.
101
102| Qualifier                               | Example                                                            |
103| ---                                     | ---                                                                |
104| `sort:creation` or `sort:creation-desc` | `sort:creation` will sort bugs by their descending creation time    |
105| `sort:creation-asc`                     | `sort:creation-asc` will sort bugs by their ascending creation time |
106
107### Sort by Edit time
108
109You can sort bugs by their edit time.
110
111| Qualifier                       | Example                                                            |
112| ---                             | ---                                                                |
113| `sort:edit` or `sort:edit-desc` | `sort:edit` will sort bugs by their descending last edition time    |
114| `sort:edit-asc`                 | `sort:edit-asc` will sort bugs by their ascending last edition time |