Closed Bug 518024 Opened 15 years ago Closed 15 years ago

Make quicksearch accept any field name or any unique starting substring of a fieldname

Categories

(Bugzilla :: Query/Bug List, enhancement, P1)

3.4.2
enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: mkanat, Assigned: mkanat)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Right now QuickSearch has a bunch of custom stuff in a "MAPPINGS" constant that allows shortcuts and various names for fields in the bugs table. Instead of that, we should allow any field to be used that can be searched on, and we should allow any starting substring of any field name to be used, as long as it uniquely matches that field. (For example, "key:" would match "keywords:" uniquely.)
We should still accept shortcuts like kw or sw.
(In reply to comment #1)
> We should still accept shortcuts like kw or sw.

  Yeah, I intend to retain backwards-compatibility for things like that, unless there's some really good reason not to do so.
Attached patch v1Splinter Review
Okay, here we go! This is actually pretty cool! :-) It does pretty much exactly what I said in comment 0.

It removes the "owner:" shortcut for "assigned_to", because the code marked that as deprecated and it's been a while since that deprecation was put there.
Assignee: query-and-buglist → mkanat
Status: NEW → ASSIGNED
Attachment #402277 - Flags: review?(wicked)
Attachment #402277 - Flags: review?(dkl)
Comment on attachment 402277 [details] [diff] [review]
v1

Oh wait, I still need to update the documentation.
Attachment #402277 - Attachment is obsolete: true
Attachment #402277 - Flags: review?(wicked)
Attachment #402277 - Flags: review?(dkl)
Attachment #402277 - Flags: review?(wicked)
Attachment #402277 - Flags: review?(dkl)
Comment on attachment 402277 [details] [diff] [review]
v1

Okay, nevermind. I'm going to fix the documentation in another bug.
Blocks: 518293
Blocks: 518459
Priority: -- → P1
Attachment #402277 - Flags: review?(dkl) → review?(LpSolit)
Attachment #402277 - Attachment is obsolete: false
Comment on attachment 402277 [details] [diff] [review]
v1

Everything looks good except that typing bug:lp crashes Bugzilla:

DBD::Pg::st execute failed: ERROR: unknown fonction lower(integer)
LINE 1: ...','UNCONFIRMED') )) AND ((POSITION(LOWER('lp') IN LOWER(bugs...
Attachment #402277 - Flags: review?(wicked)
Attachment #402277 - Flags: review?(LpSolit)
Attachment #402277 - Flags: review-
What version of Pg are you using? I can't reproduce that error.
Comment on attachment 402277 [details] [diff] [review]
v1

That's a bug in Search.pm, even if it is reproducible. The same thing would happen if you did a "contains the string" search on the bug_id field and typed a string. In any case, the input is indeed invalid, so I'm not so opposed to the whole idea of it crashing.
Attachment #402277 - Flags: review- → review?(LpSolit)
(In reply to comment #8)
> What version of Pg are you using? I can't reproduce that error.

I have Pg 8.3.8.
Comment on attachment 402277 [details] [diff] [review]
v1

r=LpSolit
Attachment #402277 - Flags: review?(LpSolit) → review+
Flags: approval+
Checking in Bugzilla/Search/Quicksearch.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search/Quicksearch.pm,v  <--  Quicksearch.pm
new revision: 1.27; previous revision: 1.26
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v  <--  user-error.html.tmpl
new revision: 1.290; previous revision: 1.289
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: relnote
Resolution: --- → FIXED
Added to the release notes in bug 547466.
Keywords: relnote
Blocks: 570072
Depends on: 487864
You need to log in before you can comment on or make changes to this bug.