Confirmed users
574
edits
(Move this from a ReST doc on my query-parser branch.) |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
The upcoming refresh of DXR's query language will make improvements to brevity, memorability, and compactness. This document represents our eventual goal. This will probably land a little at a time. | The upcoming refresh of [[DXR]]'s query language will make improvements to brevity, memorability, and compactness. This document represents our eventual goal. This will probably land a little at a time. | ||
= Simple Searching = | = Simple Searching = | ||
Line 41: | Line 41: | ||
-path:*.cpp -path:*.c fn:foo | -path:*.cpp -path:*.c fn:foo | ||
Let's try to standardize with https://code.google.com/p/chromium/codesearch as much as possible. | |||
== Obsolete == | == Obsolete == | ||
* `ext:` goes away. It's covered by ` | * `ext:` goes away. It's covered by `-path:*.c` | ||
* `*-decl:` goes away until somebody asks for it. It's merged into `*`. | * `*-decl:` goes away until somebody asks for it. It's merged into `*`. | ||
== To Be Determined == | == To Be Determined == | ||
* a way to express case-sensitivity | * a way to express case-sensitivity. Possibilities include quotes and +. | ||
= More Explicit Operators = | |||
Some people expect runs of barewords to be treated as phrase matches. Here's how we could do that. | |||
Take any continguous sequence of text: filters to be a single string. Otherwise, AND everything. | |||
For example... :: | |||
three blind mice path:*.c def | |||
…would search for "three blind mice" AND path:*.c AND "def". | |||
You can go back to the old behavior by saying explicitly... :: | |||
three AND blind AND mice | |||
Maybe we could even do… :: | |||
mice IN fn:main | |||
…or… :: | |||
fn:frob IN type:Frobulator | |||
= Quoting and Escaping = | = Quoting and Escaping = | ||
Line 78: | Line 104: | ||
These rules are akin to common shell syntax and designed so you don't need to plan ahead (or backtrack) when typing a query. | These rules are akin to common shell syntax and designed so you don't need to plan ahead (or backtrack) when typing a query. | ||
= See Also = | |||
[https://help.github.com/articles/searching-issues GitHub's issue query language] might provide some inspiration. |