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

Would it be better to index Comment rather than Topic? #326

Closed
sureshvv opened this issue Oct 8, 2023 · 5 comments
Closed

Would it be better to index Comment rather than Topic? #326

sureshvv opened this issue Oct 8, 2023 · 5 comments

Comments

@sureshvv
Copy link

sureshvv commented Oct 8, 2023

Currently Search returns the Topic but the search item is buried deep inside it - so one has to do a Find in page using the browser.

@nitely
Copy link
Owner

nitely commented Oct 8, 2023 via email

@sureshvv
Copy link
Author

Can you guide me on how to implement this missing functionality? I would like to retrieve individual comments matching the search.

@nitely
Copy link
Owner

nitely commented Jun 17, 2024

It's a lot of work. I think most search functionality lives in https://github.com/nitely/Spirit/tree/master/spirit/search . You'll need to add the comment version of it. Things like a search index, views, forms, urls, templates, etc.

For a comment you'll have fields like text (this field must contain the comment text, the search index will use it for searching on it, and it's generated by a template like this , see the haystack docs), comment_id, comment_html, and is_removed at least.

@nitely
Copy link
Owner

nitely commented Jun 17, 2024

Also, there is a task for indexing topics every time one is created here. You'll need to do the same for comments.

@sureshvv
Copy link
Author

For an initial implementation, I was able to modify spirit.search.views to extract comments from the search results and find only the matching comments and display them. May not scale well for large sites.

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

No branches or pull requests

2 participants