Note: There are a few cases of duplicates in user autocompletion which are being worked on.

QuickSearch for phrases is busted

RESOLVED FIXED in Bugzilla 3.6

Status

()

Bugzilla
Query/Bug List
--
major
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Jesse Ruderman, Assigned: Max Kanat-Alexander)

Tracking

(Blocks: 1 bug, {regression})

3.6.1
Bugzilla 3.6
regression
Dependency tree / graph
Bug Flags:
approval +
approval4.0 +
blocking4.0 +
approval3.6 +
blocking3.6.2 +

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

7 years ago
If I try to QuickSearch for a phrase, I get 200 random bugs that don't even contain the second word.  This almost prevents me from getting work done.
Blocks: 577801
No longer blocks: 558044
Assignee: nobody → query-and-buglist
Component: Bugzilla: Other b.m.o Issues → Query/Bug List
OS: Mac OS X → All
Product: mozilla.org → Bugzilla
QA Contact: other-bmo-issues → default-qa
Hardware: x86 → All
Target Milestone: --- → Bugzilla 3.6
Version: other → 3.6.1
Severity: blocker → major
Flags: blocking4.0?
Flags: blocking3.6.2?
(Assignee)

Comment 1

7 years ago
reed: I'm not entirely sure that this is an upstream bug. Can you reproduce it on landfill? I'm seeing a lot of bugs like "my search returns random results" reported against bmo.
Created attachment 457245 [details] [diff] [review]
patch - v1 (3.6 branch)

Here's a patch that should work for the 3.6 branch. 4.0 and trunk need a better fix.
Attachment #457245 - Flags: review?(mkanat)
(Assignee)

Comment 3

7 years ago
Comment on attachment 457245 [details] [diff] [review]
patch - v1 (3.6 branch)

This won't work on Pg, as mentioned on IRC:

 reed: The upstream problem is that we don't actually have a fulltext engine for Pg.
 reed: So we have to understand quotes inside of sql_fulltext or whatever it's called, in Bugzilla/DB.pm.
 reed: That could probably be accomplished by using splitwords from Text::ParseWords instead of just splitting the string.
Attachment #457245 - Flags: review?(mkanat) → review-
(Assignee)

Comment 4

7 years ago
  Or shellwords, more specifically--that tends to work the most simply.
Comment on attachment 457245 [details] [diff] [review]
patch - v1 (3.6 branch)

Landed on bmo 3.6 branch as a temp hack until a better fix is made.

Committing to: bzr+ssh://bzr.mozilla.org/bmo/3.6/
modified Bugzilla/Search/Quicksearch.pm
Committed revision 7160.

Comment 6

7 years ago
Looks like a dupe of bug 556579.
(Assignee)

Comment 7

7 years ago
(In reply to comment #6)
> Looks like a dupe of bug 556579.

  No, that bug only affects 4.0, and this bug is against 3.6.
(Assignee)

Updated

7 years ago
Flags: blocking4.0?
Flags: blocking4.0+
Flags: blocking3.6.2?
Flags: blocking3.6.2+
(Assignee)

Comment 8

7 years ago
Before I go about this: I'm assuming that Oracle fulltext understands quotes mean "this is a phrase", yes?
(Assignee)

Comment 9

7 years ago
Created attachment 458553 [details] [diff] [review]
v1

This should fix it on 3.6, 4.0, and trunk, I'm pretty sure.
Assignee: query-and-buglist → mkanat
Attachment #457245 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #458553 - Flags: review?(reed)
(Assignee)

Updated

7 years ago
Duplicate of this bug: 578576
(Assignee)

Updated

7 years ago
Blocks: 553884
Comment on attachment 458553 [details] [diff] [review]
v1

No time to get to this until minimum of next week.
Attachment #458553 - Flags: review?(reed) → review?(LpSolit)

Comment 12

7 years ago
Comment on attachment 458553 [details] [diff] [review]
v1

>=== modified file 'Bugzilla/Search/Quicksearch.pm'

>+sub _matches_phrase {
>+    $phrase =~ s/"/\\"/g;

Seems to work, but I'm not sure about to trigger this line as shellwords() splits phrases on quotes. r=LpSolit
Attachment #458553 - Flags: review?(LpSolit) → review+

Comment 13

7 years ago
I didn't check if it applies on 4.0 and 3.6.
Flags: approval?
(Assignee)

Comment 14

7 years ago
Thanks! It should apply on 4.0 and 3.6 also--there haven't been any significant changes to that code since 3.6.
Flags: approval?
Flags: approval4.0+
Flags: approval3.6+
Flags: approval+
(Assignee)

Comment 15

7 years ago
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/DB.pm
modified Bugzilla/Search/Quicksearch.pm
Committed revision 7397.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/
modified Bugzilla/DB.pm
modified Bugzilla/Search/Quicksearch.pm
Committed revision 7341.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/
modified Bugzilla/DB.pm
modified Bugzilla/Search/Quicksearch.pm
Committed revision 7144.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Assignee)

Comment 16

7 years ago
Something about this fix is breaking the fulltext search, according to the xt/search tests on our tinderboxen.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 17

7 years ago
Created attachment 461961 [details] [diff] [review]
Pg: No shellwords, v1

Okay, this fixes the problem with Pg. The problem was that shellwords absolutely can't handle unbalanced quotes--it returns an empty result if you do something like: "don't try this" for content/matches (without the double-quotes). So instead, I'm doing a hack just to allow Quicksearch to work properly on Pg.
Attachment #461961 - Flags: review?(LpSolit)
(Assignee)

Comment 18

7 years ago
BTW, there's also currently some taint error on Pg for quicksearch, on HEAD. I have to find out what it is.

Comment 19

7 years ago
Comment on attachment 461961 [details] [diff] [review]
Pg: No shellwords, v1

Seems to work fine. Let's hope we don't regress anything else. :) r=LpSolit
Attachment #461961 - Flags: review?(LpSolit) → review+
(Assignee)

Comment 20

7 years ago
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/DB.pm
Committed revision 7415.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/                         
modified Bugzilla/DB.pm
Committed revision 7358.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/                         
modified Bugzilla/DB.pm
Committed revision 7151.
Status: REOPENED → RESOLVED
Last Resolved: 7 years ago7 years ago
Resolution: --- → FIXED
This is "fixed" (upstream), do we need another bug to get this patch deployed so it's actually fixed for BMO users?
(Assignee)

Comment 22

7 years ago
(In reply to comment #21)
> This is "fixed" (upstream), do we need another bug to get this patch deployed
> so it's actually fixed for BMO users?

  Well, no, I think Mozilla just needs to employ some person who actually has time to work on bugzilla.mozilla.org. (Currently all maintenance is being done by volunteers, really.)
If it got committed to the 3.6 branch upstream, then we should have it on b.m.o already.  I just merged it again yesterday when 3.6.2 released.
You need to log in before you can comment on or make changes to this bug.