Closed
Bug 76498
Opened 23 years ago
Closed 10 years ago
QuickSearch: support comparison operators other than substring
Categories
(Bugzilla :: Query/Bug List, enhancement, P2)
Tracking
()
RESOLVED
FIXED
Bugzilla 5.0
People
(Reporter: afranke, Assigned: glob)
References
Details
(Whiteboard: [wanted-bmo])
Attachments
(1 file, 3 obsolete files)
4.26 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
Currently the generic notation for a word is field1,...,fieldN:value1,...,valueM and a bug matches iff one of the values occurs as a _substring_ in one of the fields. This should be generalized to allow other comparison operators like "regexp", "exact", and probably more. Question 1: Should there be a possibility to specify the comparison operator for each value, or is it sufficient to have the same comparison operator for all values. You can always use multiple words with an OR (or "|") between them to achieve different operators for different values, but it may still be more natural in some cases to indicate the comparison operator together with the value, e.g. it would be easy to implement that everything between /.../ is treated as a regexp. But there are other solutions. Then the main challenge is to find a good syntax for each of these operators. A single ":" is used for substring. I can think of two possible approaches: I.) use other characters _instead_ of the colon e.g. foo,bar=1,2,3 could be used for exact matching II.) use more characters _in addition to_ the colon e.g. foo,bar:=1,2,3 could be used for exact matching "::" is very easy to type, so it should be used for a frequently used operator.
Updated•23 years ago
|
Target Milestone: --- → Future
Reporter | ||
Updated•23 years ago
|
Component: Bugzilla → Query/Bug List
Product: Webtools → Bugzilla
Version: Bugzilla 2.11 → 2.11
Updated•18 years ago
|
QA Contact: mattyt-bugzilla → default-qa
Updated•18 years ago
|
Target Milestone: Future → ---
Updated•17 years ago
|
Priority: -- → P4
Comment 3•17 years ago
|
||
The content of attachment 263723 [details] has been deleted by Dave Miller (work related) <justdave@mozilla.com> who provided the following reason: Attachment was spam. The token used to delete this attachment was generated at 2007-05-04 08:36:50 PDT.
Updated•16 years ago
|
Assignee: nobody → query-and-buglist
Comment 4•12 years ago
|
||
For numeric fields such as "votes", I'd like < and > operators.
I also would like <,> for days_elapsed
Comment 6•12 years ago
|
||
I'm not convinced days_elapsed does anything sane in quicksearch in any case I get 180 bugs (mostly very old) for https://bugzilla.mozilla.org/buglist.cgi?quicksearch=%3AXBL For one day elapsed (of which there's only one) I get 70 bugs (mostly very old): https://bugzilla.mozilla.org/buglist.cgi?quicksearch=%3AXBL%20days_elapsed%3A1 As I increment the days_elapsed I get smaller and larger numbers that seem to have nothing to do with the changed date.
Assignee: query-and-buglist → glob
No longer depends on: 688967
getting quicksearch to support this is relatively simple, the hard bit will be deciding on a syntax which causes the least amount of breaking of existing queries. here's a patch which adds new symbols which can be used instead of : eg. creation_ts<-2w does "creation_ts" "lessthan" "-2w" the full map is: ':' => 'substring', '=' => 'equals', '!=' => 'notequals', '>=' => 'greaterthaneq', '<=' => 'lessthaneq', '>' => 'greaterthan', '<' => 'lessthan',
Attachment #803068 -
Flags: review?(simon)
Comment 9•11 years ago
|
||
Comment on attachment 803068 [details] [diff] [review] 76498_1.patch The patch is good (very good in fact), but you need to update the documentation with this functionality as well (template/en/default/pages/quicksearch.html.tmpl)
Attachment #803068 -
Flags: review?(simon) → review-
Assignee | ||
Comment 10•10 years ago
|
||
Attachment #803068 -
Attachment is obsolete: true
Attachment #8345700 -
Flags: review?(simon)
Comment 11•10 years ago
|
||
Comment on attachment 8345700 [details] [diff] [review] 76498_2.patch Review of attachment 8345700 [details] [diff] [review]: ----------------------------------------------------------------- ::: template/en/default/pages/quicksearch.html.tmpl @@ +234,5 @@ > + where the <kbd>summary</kbd> is not <kbd>foo</kbd>. > + </li> > + <li> > + <strong>></strong> (greaterthan):<br> > + <kbd><em>creation_ts>-2w</em></kbd> will search for [% terms.bugs %] Replace > with > Same with the documentation for >= @@ +246,5 @@ > + terms.bugs %] exactly two weeks old. > + </li> > + <li> > + <strong><</strong> (lessthan):<br> > + <kbd><em>creation_ts>-2w</em></kbd> will search for [% terms.bugs %] Replace > with < . Same with the documentation for <=
Attachment #8345700 -
Flags: review?(simon) → review-
Comment 13•10 years ago
|
||
It looks like this patch is close to r+. glob: could you update it, please?
Status: NEW → ASSIGNED
OS: Other → All
Hardware: Other → All
Target Milestone: --- → Bugzilla 5.0
Assignee | ||
Comment 15•10 years ago
|
||
Attachment #8345700 -
Attachment is obsolete: true
Attachment #8360238 -
Flags: review?(LpSolit)
Comment 16•10 years ago
|
||
Comment on attachment 8360238 [details] [diff] [review] 76498_3.patch Please backport it to bmo asap! :) r=LpSolit
Attachment #8360238 -
Flags: review?(LpSolit) → review+
Updated•10 years ago
|
Flags: approval?
Keywords: relnote
Priority: P4 → P2
Summary: QuickSearch: comparison operators other than substring → QuickSearch: support comparison operators other than substring
Comment 17•10 years ago
|
||
Comment on attachment 8360238 [details] [diff] [review] 76498_3.patch >=== modified file 'Bugzilla/Search/Quicksearch.pm' >- my @field_values = _parse_line(':', 1, $or_operand); >- if (scalar @field_values == 2) { >- my @fields = _parse_line(',', 1, $field_values[0]); >- my @values = _parse_line(',', 1, $field_values[1]); >+ my @field_values = parse_line($symbol, 1, $or_operand); >+ next unless scalar @field_values == 2; >+ my @fields = parse_line(',', 1, $field_values[0]); >+ my @values = parse_line(',', 1, $field_values[1]); Just to be sure: replacing _parse_line() by parse_line() is intentional, isn't it?
Comment 18•10 years ago
|
||
This is way cool. Make sure comment 17 is addressed, then commit at will.
Flags: approval? → approval+
Comment 19•10 years ago
|
||
We are releasing today and glob is not around, so I'm committing the patch myself. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Search/Quicksearch.pm modified template/en/default/pages/quicksearch.html.tmpl Committed revision 8895.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 20•10 years ago
|
||
I had to fix bustage on Perl 5.10 and 5.12: Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Search/Quicksearch.pm Committed revision 8896.
Assignee | ||
Comment 21•10 years ago
|
||
(In reply to Frédéric Buclin from comment #17) > Just to be sure: replacing _parse_line() by parse_line() is intentional, > isn't it? no, it isn't intentional, and reverts the fix in bug 877545 when searching for multiple values. fixed: Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Search/Quicksearch.pm Committed revision 8901.
You need to log in
before you can comment on or make changes to this bug.
Description
•