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

Extend the search to include comments #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

molecode
Copy link
Member

The main search functionality was already implemented. What I did was extending the existing SearchVector with some attributes from the comments and profile model:

  • comments__body
  • comments__user__first_name
  • comments__user__last_name
  • comments__user__email.

All new vectors got the weight A (because it was not specified which weight they should have). I also added a distinct() to the search query to avoid duplicates in the query result.

With this approach two new joins where introduced in the query. I did some performance measurements with an empty and with an lightly filled database and I didn't see any performance issues so far. I guess it depends how much data are in the specific tables.

This task was straight forward and I didn't need much time for it. I also added one test to the model tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant