Fixes issue #297
This changeset makes the search textfield on the "issues" and "pulls" pages much more powerful.
keywordand-keyword"some phrase"and-"some phrase"label:good-first-issueand-label:good-first-issueauthor:octet-stream.netand-author:octet-stream.netstate:open,state:closedandstate:mergedlabel:good-first-issueandlabel:documentationto require multiple labels
The open/closed/merged tab buttons now play a subordinate role to the textfield. When you first load the page it is populated with state:open to show the current state. If you click "closed" then this sends the current state of the query and on the server side the state tag will be replaced with state:closed for the re-rendered page. This works regardless of what other filters are currently configured and I believe I've made it all work equally with and without JS. If you wish you can manually select and delete the state: tag to see issues with different states in the same results listing.
If you are doing anything more advanced than a state: tag then bleve is used to perform the query.
This pull also fixes missing re-index triggers when labels are added/removed from issues and pulls.
Potentially controversial quirks:
- The
author:tag requires resolving the handle. This is fast if it's in the cache but a blocking operation if it's one we haven't seen before. - Clicking the "X" clears the textfield except for the
state:tag. I feel that this is useful. The other logical option is to empty the field entirely so that we are looking at all issues in all states. - Issue and pull index mappings now contain a version that will be used to detect when the index needs to be rebuilt because the code has changed the schema.
Out of scope:
- Any kind of UI to automate or guide the user to use the new tag types
Some screenshots to give you the idea...
Default view when you open the issues page:
Then you clear the textfield and press enter:
Label search:
Narrow it down with another label:
Label and a keyword together:
Rebased on latest
master