Closed Bug 578494 Opened 14 years ago Closed 14 years ago

QuickSearch for phrases is busted

Categories

(Bugzilla :: Query/Bug List, defect)

3.6.1
defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: jruderman, Assigned: mkanat)

References

()

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

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.
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?
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.
Attached patch patch - v1 (3.6 branch) (obsolete) — Splinter Review
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)
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-
  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.
Looks like a dupe of bug 556579.
(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.
Flags: blocking4.0?
Flags: blocking4.0+
Flags: blocking3.6.2?
Flags: blocking3.6.2+
Before I go about this: I'm assuming that Oracle fulltext understands quotes mean "this is a phrase", yes?
Attached patch v1Splinter Review
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)
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 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+
I didn't check if it applies on 4.0 and 3.6.
Flags: approval?
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+
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
Closed: 14 years ago
Resolution: --- → FIXED
Something about this fix is breaking the fulltext search, according to the xt/search tests on our tinderboxen.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
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)
BTW, there's also currently some taint error on Pg for quicksearch, on HEAD. I have to find out what it is.
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+
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
Closed: 14 years ago14 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?
(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.