Closed sureshvv closed 3 weeks ago
If you want to find all topics talking about X then the current search is fine.
Returning comments and searching on a single post is missing functionality.
On Sun., Oct. 8, 2023, 3:48 a.m. sureshvv, @.***> wrote:
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.
— Reply to this email directly, view it on GitHub https://github.com/nitely/Spirit/issues/326, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM6L42QA5ILC7HUYBDTTB3X6JED5AVCNFSM6AAAAAA5XPGCDSVHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZTCNRXGM2DGMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Can you guide me on how to implement this missing functionality? I would like to retrieve individual comments matching the search.
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.
Also, there is a task for indexing topics every time one is created here. You'll need to do the same for comments.
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.
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.