Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 quicksearch string matching bug #346

Closed
1 task done
josh-chamberlain opened this issue Jul 2, 2024 · 4 comments · Fixed by #347 or Police-Data-Accessibility-Project/data-sources-app-v2#50
Closed
1 task done
Assignees
Labels
bug Something isn't working fixed_in_dev This is merged into the dev environment and waiting to be merged into main quick search v1

Comments

@josh-chamberlain
Copy link
Contributor

josh-chamberlain commented Jul 2, 2024

Context

flagging this partly because it went unnoticed for so long—we should make sure we are not replicating things like this with new search: #249

Description

This is related to unexpected/missing search results in ways I don't quite understand.

Search 1: dashboard in allegheny county

Search 2: all in allegheny county jail

Search 3: dashboard in allegheny county jail

Requirements

  • diagnose the bug + identify possible steps to fix
@josh-chamberlain josh-chamberlain added bug Something isn't working quick search v1 labels Jul 2, 2024
@josh-chamberlain josh-chamberlain changed the title v1 quicksearch bug v1 quicksearch string matching bug Jul 2, 2024
@EvilDrPurple
Copy link
Contributor

Can confirm this bug is still present in dev branch of v2 as well

@EvilDrPurple EvilDrPurple self-assigned this Jul 5, 2024
@EvilDrPurple
Copy link
Contributor

EvilDrPurple commented Jul 5, 2024

It seems the issue was with the .title() here:

cursor.execute(QUICK_SEARCH_SQL.format(search.title(), location.title()))

The function capitalizes the start of every word, causing some searches to slip through the cracks since they are case sensitive. Removing them fixed the outlined searches. I'm going to make it so that the search terms and the database terms are lowercased to solve any case-sensitivity issues in searches. That is assuming there was no foreseeable reason for it to have been set up this way in the first place

@EvilDrPurple
Copy link
Contributor

PRs submitted for both v1 and v2

@josh-chamberlain
Copy link
Contributor Author

case sensitivity should never be a thing for these searches. thank you!

@josh-chamberlain josh-chamberlain added the fixed_in_dev This is merged into the dev environment and waiting to be merged into main label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed_in_dev This is merged into the dev environment and waiting to be merged into main quick search v1
Projects
Status: Done
2 participants