Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Feature Request: Conversation-independent search within Rocket.Chat #62

Closed
janrudolph opened this issue Sep 8, 2017 · 12 comments
Closed
Assignees
Labels
Milestone

Comments

@janrudolph
Copy link
Collaborator

janrudolph commented Sep 8, 2017

Situation:
Users ask questions, discuss possible solutions and find the right answer. After a typical question/answer process, the users finish the conversation and the conversation is stored in Smarti. The system deletes the users' subscriptions and the conversation disappears.

Later, a user might remind that there was a conversation, which could help in a new situation. The user likes to look up the conversation. However, it is hard to find the right one, because Smarti and Rocket.Chat do not provide a conversation-independant search.

Possible Solution:

  • Use the Rocket.Chat channel search to search smarti conversations
  • Add another search endpoint in Rocket.Chat to search smarti conversations
@janrudolph
Copy link
Collaborator Author

User Story
As user I want to find historic conversations based on keywords so that I can look-up solutions without starting a conversation.

Acceptance Criteria:

  • Search integrates into the chat application's UI.
  • Filtering on topic is possible.

@mrsimpson Should we move this issue to our Rocket.Chat branch?

@westei
Copy link
Member

westei commented Sep 25, 2017

We can provide such a service based on the conversation index. We will need to wrap Solr with a Webservice as we need to add FilterQueries to parsed searches to enforce access restrictions.

@mrsimpson mrsimpson added this to the Delta-Sprint milestone Sep 25, 2017
@tkurz tkurz added ready and removed ready labels Sep 25, 2017
@ghost ghost assigned ja-fra Sep 26, 2017
@ghost ghost added in progress and removed ready labels Sep 26, 2017
ja-fra added a commit that referenced this issue Oct 2, 2017
Allow conversation-independent search (closes #62)
@lobo87
Copy link

lobo87 commented Oct 3, 2017

Ok, I did some digging in the code in order to get an idea on how to override the default search like discussed yesterday. By overriding the default behaviour we would be able to inject our search results. However this seems to be quite complicated caused by the weird implementation. There aren't any good locations in the code where i can hook into. Nevertheless, this analysis yields two possible ways to implement the search:

  1. Two things happen while searching: First it checks the local collection of the mongo and afterwards it requests the server for further findings. The second part is done by calling a custom Meteor function "spotlight". (See server/publications/spotlight.js) This function is called 3 times thoughout the whole project. We could now change the core code of the spotlight method in order to inject our results.

  2. We overwrite the toolbox template (this template is responsible for the search input rendering) and implement the search functionality on our own. (e.g. requesting our results and the spotlight results and merging them together). Unfortunately this means, that functionality given by the present implementation (like moving up/down through the results with a keypress) needs to be reimplemented by us.

Which way should I go, @mrsimpson?

@mrsimpson
Copy link
Collaborator

@lobo87 I'd go for a dedicated hook which should be provided in Rocket.Chat Core (we should create an issue for that and contribute the hook) in order to go for approach 1).
This hook could pass an array of rooms for which the user is in general authorized to the search engine. This is necessary as we don't have authorization mechanisms (ACL on rooms) on the Smarti-side (yet).
WDYT?

@lobo87
Copy link

lobo87 commented Oct 3, 2017

@mrsimpson so if i get you right, you want to create a similar method "spotlight" which does the same as the core method plus injecting custom search results. This method will the be called instead of the spotlight one? That means replacing Meteor.call('spotlight') by Meteor.call('new-spotlight')

As far as I have seen, Rocket.Chat does not provide any callback for the search, we could hook onto.

Or do you want me to create a new hook and call that during search phase so we can hook to?

@lobo87
Copy link

lobo87 commented Oct 3, 2017

I think having custom hooks for the search (searchStart, beforeClientSearch, afterClientSearch, beforeServerSearch, afterServerSearch, searchComplete) would be the best way. I like this proposal. This way we can hook into at any place during the search and modify the results. This however means we need to modify the Rocket.Chat core.

@mrsimpson
Copy link
Collaborator

mrsimpson commented Oct 3, 2017

@lobo87 Modifying Rocket.Chat-Core is fine as long as we can contribute it back. For that, we need to create an issue specifying the needs. I've quickly done that: RocketChat/feature-requests#745 .
My recommendation: Fork-off Rocket.Chat/develop, add what's missing in RC Core and open a PR referencing this issue. We can surely make someone look at it soon.
Then, fork-off assistify/develop, merge the modification and implement the hook issuing the search towards Smarti.
I expected one callback (onSpotlightSearch(accessibleRooms) returns roomIds) to be sufficient

@lobo87
Copy link

lobo87 commented Oct 3, 2017

alright, i'll do that.

@mrsimpson
Copy link
Collaborator

mrsimpson commented Oct 3, 2017

@lobo87

I expected one callback (onSpotlightSearch(accessibleRooms) returns roomIds) to be sufficient

Why do you think we'll need multiple callbacks?

See https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-lib/server/functions/sendMessage.js#L55-L59 for some hook-definition-sample.

@lobo87
Copy link

lobo87 commented Oct 3, 2017

@mrsimpson

Why do you think we'll need multiple callbacks?

i thought it would be a good idea to have more hooks in order to be more flexible. In this case it is propaby sufficient to implement just one.

@mrsimpson
Copy link
Collaborator

@lobo87 added you to our Rocket.Chat fork (https://github.com/assistify/Rocket.Chat/). If you start the PR towards Rocket.Chat from there, we can contribute to that as well

@ja-fra
Copy link
Member

ja-fra commented Oct 3, 2017

Please move the discussion about the search-integration into rocket.chat to assistify/Rocket.Chat#76.

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

No branches or pull requests

7 participants