Closed Bug 970184 Opened 7 years ago Closed 7 years ago

"possible duplicates" shouldn't truncate words at the first non-word character

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: glob, Assigned: glob)

References

Details

Attachments

(1 file)

currently "possible duplicates" does the following:

> # Exclude punctuation from the array.
> @words = map { /(\w+)/; $1 } @words;

this means that all words in the search term are truncated at the first \W character, which can dramatically alter the search.

eg.
entering "gfx-surface-quartz" will search for "gfx"
entering "shouldn't" will search for "shouldn"

i'm not sure what the original purpose of this line is, however given its results i think we should just remove it, and always search on words as entered.
Attached patch 970184_1.patchSplinter Review
during testing i realised the issue it's trying to fix.

if you search for
> "this is" of course, a test, isn't it?
" , and ? need to be removed in order to have sane searches.

so instead of just removing that line, this patch changes it so it only removes leading and trailing punctuation from words.
Attachment #8373138 - Flags: review?(dkl)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 883076
i'm going to dupe bug 883076 here, since this bug has a patch.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Status: REOPENED → ASSIGNED
Duplicate of this bug: 883076
Comment on attachment 8373138 [details] [diff] [review]
970184_1.patch

Review of attachment 8373138 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8373138 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval4.4?
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → Bugzilla 4.4
Flags: approval?
Flags: approval4.4?
Flags: approval4.4+
Flags: approval+
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Bug.pm
Committed revision 8915.

Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/Bug.pm
Committed revision 8658.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.