Save the search.html in your local filesystem somewhere.
In a chromium-like browser.
Manage search engines. Create search ending with nickname 'eji'.
Add this as search url (remove line breaks): (This example is for Jira search in a specific project)
file:///PATH/TO/search.html
?pattern=https://jira.example.com/jira/issues/?jql=project=@0 ORDER BY key DESC
&pattern=https://jira.example.com/jira/issues/?jql=project=@0 AND text ~ "@@" ORDER BY key DESC
#%s
In your browser address bar, type "eji MYPROJECT my search terms" -> you get a Jira search for project=MYPROJECT and search text = "my search terms".
Later, type "eji MYPROJECT" -> you get a Jira search in project=MYPROJECT, without the search terms.
Later, type "eji MYPROJECT my search terms#debug" -> you get a debug page, which is useful to fine-tune your search engine.
In the example above, "MYPROJECT my search terms" is the search string, which is split into ['MYPROJECT', 'my', 'search', 'terms'].
In the "pattern" urls, the '@0' placeholder is for the first part ("MYPROJECT"), the '@1' placeholder would be for the second part ("my"). The "@@" placeholder is for the remaining parts. In this case, because "@1" does not exist, that is "my search terms".
With "eji MYPROJECT my search terms", the first pattern does not match, because there is no "@1" and no "@@". So it goes to the second pattern. With "eji MYPROJECT", the first pattern matches, so it uses that for the destination url.