Improve search to perform basic substring, case-insensitive matches #70

Manually merged
cmccabe merged 2 commits from fix-search into master 2019-12-28 12:23:55 +00:00
Collaborator

Search previously would only look for an exact match of a field, which I missed earlier. For example, a link with the title "cat" would be returned if the search term was "cat", but not if it was "c".

A search result should now be returned if the search term is found in any field. It can be the entire field or just a part of the field. Furthermore, searches should be case insensitive.

The main part of this change is that we look for keyword.lower() in str(record).lower() where record is a row in link_data. If there's a better approach than this, let me know.

Along with these changes are tests to cover the situations mentioned (including an existing test that was not written correctly). The test file names have been normalised as well.

Search previously would only look for an exact match of a field, which I missed earlier. For example, a link with the title "cat" would be returned if the search term was "cat", but not if it was "c". A search result should now be returned if the search term is found in any field. It can be the entire field or just a part of the field. Furthermore, searches should be case insensitive. The main part of this change is that we look for `keyword.lower() in str(record).lower()` where record is a row in `link_data`. If there's a better approach than this, let me know. Along with these changes are tests to cover the situations mentioned (including an existing test that was not written correctly). The test file names have been normalised as well.
asdf added the
bug
label 2019-12-28 10:31:41 +00:00
cmccabe closed this pull request 2019-12-28 12:23:55 +00:00
Owner

Got it and I'm seeing results on the rtc install now!

Got it and I'm seeing results on the rtc install now!
asdf deleted branch fix-search 2020-01-10 08:42:37 +00:00
Sign in to join this conversation.
No description provided.