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
Confirmed
Undecided
Unassigned
3.10
Confirmed
Undecided
Unassigned
3.11
Confirmed
Undecided
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
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.