Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11545 closed defect (fixed)

Search returns milestone resource when only one word matches — at Version 5

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.2
Component: search system Version: 1.0-stable
Severity: normal Keywords: roadmap
Cc: Branch:
Release Notes:

Fixed milestone search returning results when only one word from phrase matched.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

For a long time I've been noticing that the milestones would almost always appear in my search results, even for cases that I wouldn't expect them to appear. It looks like a milestone will be returned in the search results when there is a match from only one word of a multiword phrase.

The following test was done to prove the case:

  1. Generated 3 words at http://listofrandomwords.com: Semiphilosophic opportunistic sulphur
  2. Created 4 tickets: one ticket with the phrase as the summary and three tickets containing one word of the phrase as the summary.
  3. Created 4 tickets: one ticket with the phrase as the description and three tickets containing one word of the phrase as the description.
  4. Created 4 milestones: one milestone with the phrase in the description and three milestones containing one word of the phrase in the description.
  5. Created 4 wiki pages: one wiki page with the phrase in the content and three wiki pages containing one word of the phrase in the content.

Here are the search results:

Change History (6)

by Ryan J Ollos, 10 years ago

Attachment: SearchResults.png added

comment:1 by Peter Suter, 10 years ago

I think it was changed in [11525] and could be fixed by changing any() to all(). (untested)

comment:2 by Ryan J Ollos, 10 years ago

Description: modified (diff)

comment:3 by Christian Boos, 10 years ago

Good catch! Right, all() seems appropriate to reproduce the behavior of the former SQL query in trunk/trac/search/api.py@11528#L54.

comment:4 by Ryan J Ollos, 10 years ago

Milestone: next-stable-1.0.x1.0.2
Owner: set to Ryan J Ollos
Status: newassigned

Thanks for providing a fix. I've prepared the change along with a unit test in log:rjollos.git:t11545.

comment:5 by Ryan J Ollos, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [12593], merged to trunk in [12595].

Note: See TracTickets for help on using tickets.