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

Search: Swap in fulltext, allow querying by time range, clamp start_time and limit #2252

Merged
merged 4 commits into from Nov 20, 2018

Conversation

Projects
None yet
1 participant
@kevinrobinson
Copy link
Contributor

kevinrobinson commented Nov 20, 2018

Part of #2243.

Who is this PR for?

educators

What problem does this PR fix?

Searching notes didn't work with case mismatches, and didn't do any processing like stemming. It also didn't allow setting the time range, and would let clients query for all data.

What does this PR do?

First, it uses Postgres fulltext operators for matching text instead of LIKE. This includes stemming and filtering stop words. There's no ranking; all results are still time-ordered. I looked at websearch_to_tsquery which would be great but this is new in Postgres 11. It was just released as beta on Heroku, but this requires a database migration so cutting it from this PR.

Second, it allows searching by time range, defaulting to just the school year.

Third, the server clamps the time range that the client sends and the limit that it sends as well.

Screenshot (if adding a client-side feature)

screen shot 2018-11-20 at 5 44 54 pm

Checklists

Which features or pages does this PR touch?

  • Search notes

Does this PR use tests to help verify we can deploy these changes quickly and confidently?

  • Included specs for changes
  • Improved specs for existing code in need of better test coverage
  • Manual testing made more sense here
@kevinrobinson

This comment has been minimized.

Copy link
Contributor

kevinrobinson commented Nov 20, 2018

selfie

@kevinrobinson kevinrobinson merged commit 8fbcdf9 into master Nov 20, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kevinrobinson kevinrobinson deleted the feature/search-full-text branch Nov 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment