Blank or Wildcard Search for Course by Instructor Fails

Bug #1968754 reported by Beth Willis
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.10
Fix Released
Medium
Unassigned
3.11
Fix Released
Medium
Unassigned

Bug Description

EG 3-8-0

When searching for courses in the OPAC, a BLANK or wildcard (*) search returns a list of results if the search is performed using either the Course Name or Course Number index. A BLANK or wildcard (*) search of the Instructor index, however, returns no results. An Instructor search should work the same as the Course Name and Course Number searches.

Note: See related LP bug: https://bugs.launchpad.net/evergreen/+bug/1913340

Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

On 3.8.0 I can replicate what Beth sees with a BLANK search.

When I try to do a wildcard search I get an internal server error for Course Name or Course Number. A wildcard search for Instructor returns no results (but does not give me an internal server error).

Changed in evergreen:
status: New → Confirmed
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

The top two commits on this branch should resolve this issue: user/sandbergja/lp1968754_instructor_search

It also includes a handful of tests to hopefully prevent some regressions in this feature.

Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
tags: added: pullrequest
Revision history for this message
Garry Collum (gcollum) wrote :

In testing the patches. A search of just a wild card in the instructor field does return all results, but if I add the wildcard character to a string (d*) to search for courses with instructors that start with 'd', no results are returned.

The course name and course number searches using 'contains' seem to truncate the search. For example, if the course is Art History, with a course number Art 100, a search for 'ar' returns results. But a search for an instructor named 'Davis', is not retrieved using a search of 'da'.

Revision history for this message
Terran McCanna (tmccanna) wrote :

Removing pullrequest as per testing comment #3

tags: added: needswork
removed: pullrequest
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote (last edit ):

I amended my second commit to handle instructor wildcard characters. Please note: the instructor wildcard only will work at the end of the string.

This is because it's implemented as a tsquery prefix wildcard search in postgres. If we wanted more fully featured wildcard searching for instructors, while retaining the ability to search names in any order (firstname lastname vs. lastname, firstname), we'd have to do some more extensive re-thinking, which I'd suggest is outside the scope of the original report.

tags: added: pullrequest
removed: needswork
Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
Changed in evergreen:
milestone: none → 3.10.2
Revision history for this message
Beth Willis (willis-a) wrote :

Testing notes:

-- I logged in to a BR1 workstation
-- I added users (Victor Hart, Jan Lindsey Copeland) to three courses assigning the "Instructor" role in each case
-- I searched courses by Instructor and found the following:

  -- Adding an asterisk (*) to the end of any search string correctly returns the expected courses.
  -- Including a space in the search term, for example, when searching the instructor’s full name (e.g. Victor Hart), resulted in an internal server error.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Oooh, good catch, Beth. Pushed a fix to the same branch (user/sandbergja/lp1968754_instructor_search)

Revision history for this message
Beth Willis (willis-a) wrote :

Jane, thanks for this fix. I can now search by instructor using a search string including one space (e.g. first name and last name). However, if the search includes multiple spaces (e.g. two-word first name and last name), the internal server error still appears.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for your careful testing, Beth! It's getting there. :-D I force-pushed a fix to that same branch. It's now the top three commits on user/sandbergja/lp1968754_instructor_search

Changed in evergreen:
milestone: 3.10.2 → 3.10.3
Changed in evergreen:
milestone: 3.10.3 → 3.12-beta
Andrea Neiman (aneiman)
Changed in evergreen:
assignee: nobody → Andrea Neiman (aneiman)
Andrea Neiman (aneiman)
Changed in evergreen:
assignee: Andrea Neiman (aneiman) → nobody
Revision history for this message
Steven Mayo (stmayo) wrote :

Testing Notes:
   Created Courses instructed by Victor Hart, Cora Jones, Jan Lindsey Copeland
 -- Searching by instructor for 'Jan Lindsey Copeland' returned her single course correctly, saw no internal server error
 -- Searching for 'Cora' returned her single course
 -- Searching by instructor for 'C' returned no courses - I guess the search is looking for exact word matches
 -- Searching for 'C*' returned the Cora Jones and Jan Lindsey Copeland courses
 -- Searching for 'Lind' returned no courses
 -- Searching for 'Lindsey' returned the Jan Lindsey Copeland course
 -- Searching for 'V*' returned the Victor Hart course
 -- Searching for 'i*' returned no courses
 -- Searching for '*i*' returned no courses
 -- Searching for '*' returned all courses
 -- Searching by instructor for '**' returned all courses
 -- Searching for ' ' returned all courses
 -- Searching by instructor for ' ' returned all courses
 -- Searching by instructor for '!' returned no courses
 -- Searching by instructor for '?' returned no courses
 -- Searching by course name for '?' returned an internal server error. Different bug.
 -- Searching by instructor for '$' returned no courses. But it won't crash if someone named Ca$h Money teaches a course
 -- Searching by instructor for '{' returned no courses

Seems more resilient than the Course Name search at this point.

I have tested this code and consent to signing off on it with my name, Steven Mayo and my email address, <email address hidden>.

tags: added: signedoff
Andrea Neiman (aneiman)
Changed in evergreen:
assignee: nobody → Andrea Neiman (aneiman)
Revision history for this message
Andrea Neiman (aneiman) wrote :

Steven beat me to the signoff, but I also tested this & found it does the thing :) :)

I have tested this code and consent to signing off with my name, Andrea Buntz Neiman, and my email address <email address hidden>

Michele Morgan (mmorgan)
Changed in evergreen:
assignee: Andrea Neiman (aneiman) → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

A huge improvement to course instructor searching!

Pushed to main, rel_3_11 and rel_3_10.

Thanks Jane, Steven and Andrea!

Changed in evergreen:
assignee: Michele Morgan (mmorgan) → nobody
status: Confirmed → Fix Committed
importance: Undecided → Medium
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.