-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[WIP]: Fulltext search (#8381) #8714
Closed
mrsimpson
wants to merge
192
commits into
RocketChat:develop
from
assistify:core/#8381-fulltext-search
Closed
Changes from 189 commits
Commits
Show all changes
192 commits
Select commit
Hold shift + click to select a range
409fe51
Bump version to 0.59.0-rc.0
rodrigok 7778345
fix sidebar paddings (#7888)
karlprieb 5812d21
Makes text action menu width based on content size (#7887)
gdelavald 7b3b93a
Fix livechat icon (#7886)
karlprieb 3af70c0
Merge pull request #7885 from RocketChat/message-actions-alignment
gdelavald 989b927
Merge pull request #7883 from RocketChat/fix-mobile-popover
gdelavald 2988024
[FIX] hyperlink style on sidebar footer (#7882)
karlprieb 19217f0
Merge pull request #7881 from RocketChat/fix-search-overlap
gdelavald 3309949
Adds default search text padding for emoji search and removes a conso…
gdelavald a286fec
Merge pull request #7880 from RocketChat/fix-sidebar-alignments
gdelavald 00a0d5e
Bump version to 0.59.0-rc.1
rodrigok c5ad8ba
Merge pull request #7893 from RocketChat/hotfix/remove-window-rocketD…
ggazzo f73ab34
Merge pull request #7894 from RocketChat/remove-flex-tab-close
rodrigok 9f1b309
Merge pull request #7895 from RocketChat/hotifx/brk-realtime-api-noti…
rodrigok 2345962
Merge pull request #7904 from RocketChat/fix-livechat-toggle
rodrigok 617b3ae
Merge pull request #7912 from luizbills/patch-1
rodrigok a38ee46
Bump version to 0.59.0-rc.2
rodrigok 8c3910d
Merge pull request #7712 from seekingalpha/show-leader-on-first-load
rodrigok f2aa86e
Merge pull request #7909 from rafaelks/patch-1
rodrigok 641474a
Update BlackDuck URL (#7941)
engelgabriel 5568591
Merge pull request #7942 from RocketChat/firefox-createchannel
rodrigok fc3fd84
Merge pull request #7943 from RocketChat/firefox-emoji
rodrigok faf4f19
Merge pull request #7945 from josiasds/fix-account-profile-placeholders
rodrigok 5198b2b
Merge pull request #7948 from Lawri-van-Buel/develop
engelgabriel fe97895
Merge pull request #7953 from RocketChat/firefox-username
engelgabriel 68c25a3
Merge pull request #7954 from RocketChat/otr-buttons
rodrigok 5c582e3
Merge pull request #7960 from RocketChat/sidebar-colors
rodrigok a691b2e
Merge pull request #7963 from RocketChat/fix-status-member-list
rodrigok c974bda
Merge pull request #7965 from RocketChat/hotfix/markdown-code-render
rodrigok 5c6d514
Merge pull request #7970 from RocketChat/padding-fixes
engelgabriel 4578242
Merge pull request #7971 from RocketChat/padding-fixes
engelgabriel cbf9d90
Merge pull request #7984 from RocketChat/hotfix/textarea-autofocus
rodrigok 4f16ade
Merge pull request #7986 from RocketChat/fix-textarea-firefox
rodrigok 6dbfad7
Merge pull request #7944 from RocketChat/fix-embedded
rodrigok c49d86a
Merge pull request #7927 from aditya19496/sidepane-scrollbar-fix
rodrigok eb2ffde
Merge pull request #7985 from RocketChat/text-area-mobile
rodrigok fcf6886
Bump version to 0.59.0-rc.3
rodrigok 3439d73
Merge pull request #7754 from RocketChat/fix-mentions-email-notification
rodrigok 7848a5a
Merge pull request #7989 from Rzeszow/develop
engelgabriel 28cfdf5
Merge pull request #7998 from RocketChat/improvements/emoji-sort
rodrigok 6016e05
Merge pull request #8001 from RocketChat/hotfix/autotranslate-parse-e…
engelgabriel 0b109f3
Merge pull request #8014 from alexbrazier/bugfix/scrollbar
engelgabriel 4bf3990
Merge pull request #8017 from RocketChat/user-status
engelgabriel ca4ce25
Merge pull request #8018 from RocketChat/search-results-height
engelgabriel be6812e
Merge pull request #8019 from RocketChat/messagebox-autogrow
rodrigok ff6b4df
Merge pull request #8039 from RocketChat/fix-clipboard
rodrigok 4957576
Merge pull request #8046 from RocketChat/prevent-autotranslate-race-c…
rodrigok 678fe0b
Merge pull request #8048 from RocketChat/fix-invisible-leader
rodrigok 7e39818
Merge pull request #7988 from RocketChat/action=messages
rodrigok 4b60f88
Bump version to 0.59.0-rc.4
rodrigok 10119ea
Merge pull request #8047 from RocketChat/fix-scroll-on-texarea
engelgabriel 8ce943c
Merge pull request #8054 from Kiran-Rao/patch-1
rodrigok b6034b6
Merge pull request #8059 from RocketChat/fix-default-email-notification
rodrigok 74f85fd
Merge pull request #8099 from RocketChat/set-avatar-on-ldap-login
rodrigok eab15e9
Merge pull request #8122 from RocketChat/hotifx/settings-description-fix
rodrigok 8643d35
Merge pull request #8101 from RocketChat/dynamic-popover
rodrigok cf69af6
Merge pull request #8112 from RocketChat/rtl
rodrigok c75d029
Bump version to 0.59.0-rc.5
rodrigok 11af5f1
Merge pull request #8073 from RocketChat/meteor-1.5.2
rodrigok b4a9d4f
Merge pull request #8094 from RocketChat/audio-notification-translations
engelgabriel 01dc20d
Merge pull request #8144 from RocketChat/fix-new-room-sound
rodrigok 16e1877
Merge pull request #8159 from RocketChat/hotfix/text-lost-on-reload
rodrigok cc4702f
Merge pull request #8146 from astax-t/issue-8145
rodrigok a6808cc
Merge pull request #8147 from RocketChat/fix-the-members-list-rest-api
rodrigok 541af14
Merge pull request #8154 from RocketChat/sidebar-rtl-alignment
rodrigok adc895a
Merge pull request #8167 from ruKurz/bugfix-8166
rodrigok b3cadfb
Merge pull request #8172 from TriPhoenix/file-upload-allow-whitelist
rodrigok da5d812
Bump version to 0.59.0-rc.6
rodrigok 6a96511
Merge pull request #8190 from RocketChat/scroll
rodrigok 0bac5d8
Merge pull request #8194 from RocketChat/more-rtl-fixes
rodrigok 4be07ae
Merge pull request #8197 from RocketChat/dep-update
rodrigok 211adb2
Merge pull request #8210 from RocketChat/fix-avatar
rodrigok a483db8
Merge pull request #8211 from Darkneon/fix-terms-of-serice-with-prefix
rodrigok b4651db
Merge pull request #8213 from RocketChat/leave-and-hide
rodrigok dc9c0dd
Bump version to 0.59.0-rc.7
rodrigok 6634cee
Merge pull request #8216 from arminfelder/0.57.2-meteorSamlMergeCaseI…
rodrigok f9d9538
Merge pull request #8241 from RocketChat/rodrigok-patch-2
rodrigok 343c134
Merge pull request #8243 from RocketChat/fix-leave-and-hide
rodrigok 8e10974
Merge pull request #8244 from RocketChat/disable-perfect-scrollbar
rodrigok 9ffb19a
Merge pull request #8252 from RocketChat/hover-mentions
engelgabriel b04faf8
Merge pull request #8259 from RocketChat/fix-popover-clipboard
engelgabriel c40c653
Merge pull request #8260 from RocketChat/read-only
engelgabriel 5b3fd59
Merge pull request #8261 from RocketChat/fix-reply-rtl
engelgabriel 8edaf1c
Merge pull request #8262 from RocketChat/hover-mentions
engelgabriel b5b6f48
Merge pull request #8257 from RocketChat/hover-color
engelgabriel a080cf6
Merge pull request #8253 from vcapretz/fix-broken-link-readme
engelgabriel a51e992
Bump version to 0.59.0-rc.8
rodrigok e0f8247
Merge pull request #8237 from matheusml/fix-8168
engelgabriel abc12dc
Merge pull request #8266 from intwarehq/rtl-room-info-buttons
engelgabriel 929bada
Merge pull request #8269 from intwarehq/some-translation-fix
engelgabriel 5a5026e
Merge pull request #8270 from Rzeszow/develop
engelgabriel 1221887
Merge pull request #8271 from intwarehq/fix-attachment-icons-alignment
engelgabriel 6663d0a
Merge pull request #8273 from RocketChat/meteor-update
rodrigok 9543632
Merge pull request #8278 from intwarehq/rtl-modal-cancel-button
engelgabriel cb8fa8f
Merge pull request #8282 from RocketChat/hover-color
rodrigok 9ef9376
Merge pull request #8286 from RocketChat/added-placeholder-translatoins
rodrigok 22d8456
Merge pull request #8295 from Darkneon/fix-accessing-undefined-attach…
rodrigok 3e72e0c
Merge pull request #8296 from RocketChat/hotfix/s3-download-file-name
engelgabriel ab63393
Merge pull request #8298 from RocketChat/hotfix/exception-on-room-not…
engelgabriel 1156ad1
Merge pull request #8299 from RocketChat/scroll-admin
rodrigok 96528fe
Merge pull request #8300 from RocketChat/fix-emojipicker-index
rodrigok 0e2de7c
Merge pull request #8304 from RocketChat/add-rdstation-livechat-integ…
rodrigok 412f8be
Merge pull request #8307 from RocketChat/call-button-rtl
rodrigok 5097a5b
Merge pull request #8310 from RocketChat/disable-travis-chache-on-tags
rodrigok 0cbf5b5
Bump version to 0.59.0-rc.9
rodrigok a494cf5
Deps update
rodrigok bd33117
Bump version to 0.58.3
rodrigok 5114ce8
Merge pull request #8316 from RocketChat/hotfix/mention-indicator
rodrigok b0c7fd0
Merge pull request #8315 from RocketChat/message-actions-popover
rodrigok 16ecc69
Merge pull request #8317 from RocketChat/MartinSchoeler-patch-1
rodrigok 7827574
Merge pull request #8331 from RocketChat/mobile-file-upload
rodrigok 63b910e
Merge pull request #8334 from RocketChat/admin-embedded-version
rodrigok 3403d8b
Merge pull request #8314 from szluohua/synchronizing
rodrigok 30838bc
Merge pull request #8355 from RocketChat/meteor-update
rodrigok 36862d9
Bump version to 0.59.0-rc.10
rodrigok dd6dd6c
Merge pull request #8335 from RocketChat/0.58.3
rodrigok 24d6053
Merge pull request #8345 from RocketChat/remove-lastact
rodrigok 0b5bd77
Merge pull request #8357 from RocketChat/fix-missing-i18n
rodrigok c0fa17c
Merge pull request #8360 from RocketChat/reduce-accountbox-size
engelgabriel ca60ad9
Merge pull request #8362 from RocketChat/sidebar-item-width
engelgabriel 36fa795
Merge pull request #8361 from RocketChat/mentions-badge
engelgabriel 47ed90a
Merge pull request #8358 from RocketChat/remove-accountBox
engelgabriel 5a6dee9
Merge pull request #8363 from RocketChat/lingohub_based_on_develop
rodrigok a5c8e20
Merge pull request #8364 from RocketChat/meteor-deps-update
engelgabriel 76935e3
Merge pull request #8372 from RocketChat/improvements/ldap
rodrigok f12b732
Merge pull request #8375 from RocketChat/lingohub_based_on_develop
rodrigok ade5fee
Bump version to 0.59.0-rc.11
rodrigok 3a90df3
[FIX] Meteor accounts issue - function which caused users to be logg…
rodrigok 3e69c89
Merge pull request #8389 from RocketChat/fix-snap-npm-dep
rodrigok c51011e
Merge pull request #8390 from RocketChat/fixes-for-slack-import
rodrigok cf1eef4
Merge pull request #8408 from RocketChat/rest-api-improve-json-query-…
rodrigok 60fa18c
Bump version to 0.58.4
rodrigok 4ee2d4a
Merge branch 'master' into 0.58.4
rodrigok b6eb0b0
Merge pull request #8420 from RocketChat/0.58.4
rodrigok cc6fad4
Merge pull request #8398 from RocketChat/improvements/ldap-size-config
rodrigok 17472d8
Merge pull request #8408 from RocketChat/rest-api-improve-json-query-…
rodrigok 830849a
Merge pull request #8394 from RocketChat/fix-snippet-i18n
rodrigok 49cef0d
Merge pull request #8386 from RocketChat/katex
rodrigok 55398f1
Merge pull request #8397 from intwarehq/fix-8384
rodrigok 4fd0d3d
Merge pull request #8390 from RocketChat/fixes-for-slack-import
rodrigok b20094a
Merge pull request #8389 from RocketChat/fix-snap-npm-dep
rodrigok 8ddfc66
Merge pull request #8414 from RocketChat/improvements/ldap-reconnect
rodrigok 4055689
Merge pull request #8417 from RocketChat/improvements/ldap-internal-l…
rodrigok 061ecaf
Merge pull request #8416 from RocketChat/account-menu-rtl
rodrigok 7932694
Bump version to 0.59.0-rc.12
rodrigok 2d95ca1
Merge pull request #8451 from RocketChat/improvements/markdown-parser
rodrigok 47afc0b
Merge pull request #8457 from RocketChat/improvements/ldap-memory-leak
rodrigok 941051c
Merge pull request #8459 from RocketChat/improvements/md-autolinker-d…
rodrigok 74a8fce
Bump version to 0.59.0-rc.13
rodrigok aea9c73
Merge pull request #8490 from RocketChat/hotfix/enable-autolinker
rodrigok 342ed3a
Merge pull request #8489 from RocketChat/hotfix/reset-password-messag…
rodrigok a38d917
Merge pull request #8491 from RocketChat/hotfix/join-code
rodrigok ddd6a73
Merge pull request #8514 from RocketChat/hotfix/uncessary-route-reload
rodrigok d9fda62
Merge pull request #8516 from RocketChat/hotfix/cant-change-password
rodrigok 41fe575
Merge pull request #8463 from RocketChat/migration-colors
rodrigok 2b8cfeb
Merge pull request #8515 from RocketChat/change-artifact-path
rodrigok 3c68961
Bump version to 0.59.0-rc.14
rodrigok 840e9cd
Fix artifact path
geekgonecrazy be35d68
Merge pull request #8520 from RocketChat/hotifx/cpu-load
rodrigok 66e6394
Bump version to 0.59.0-rc.15
rodrigok b9585e0
Merge pull request #8518 from RocketChat/fix-artifact-path
rodrigok 8b15ba8
Merge pull request #8527 from RocketChat/do-not-send-joincode-field-t…
rodrigok cb119f1
Bump version to 0.59.0-rc.16
rodrigok 3096344
Merge pull request #8529 from RocketChat/improvements/fast-room-sync
rodrigok c4d7fab
Bump version to 0.59.0-rc.17
rodrigok a7d50fb
Merge branch 'release-candidate'
rodrigok 8f9a85b
Bump version to 0.59.0
rodrigok bf6993e
Merge pull request #8544 from RocketChat/hotfix/migration-103
rodrigok 7cca958
Merge pull request #8541 from RocketChat/hotifx/ldap-login-error
rodrigok c61036b
Merge pull request #8547 from RocketChat/hotfix/revert-wrong-colors-f…
rodrigok 1a29fd0
Merge pull request #8543 from RocketChat/hotfix/color-reset
rodrigok 39b401c
Merge branch 'release-candidate'
rodrigok 0710c94
Bump version to 0.59.1
rodrigok 111a53d
Merge pull request #8577 from RocketChat/fix-livechat-guest-pool
rodrigok 1e99e7b
Merge pull request #8551 from joesitton/fix-upload-uri-error
rodrigok 16fde7b
Merge pull request #8613 from RocketChat/hotifx/ldap-merge-users
rodrigok d758ca6
Merge pull request #8635 from RocketChat/hotfix/channel-members-sort
rodrigok 724fdf5
Merge pull request #8634 from RocketChat/message-popup-menu-mobile
rodrigok 206d413
Merge pull request #8637 from RocketChat/create-channel-scroll
rodrigok b65f3a6
Merge branch 'release-candidate'
rodrigok 69df205
Bump version to 0.59.2
rodrigok 249716e
created packages for search
mrsimpson f2cea86
search provider interface definitions
mrsimpson cb63830
Skeleton of implementation
mrsimpson 31b2ffe
Merge remote-tracking branch 'upstream/develop' into core/#8381-fullt…
mrsimpson a0f8a8a
Search interface and initial load defined.
mrsimpson 3c84630
Provide implementation stub
mrsimpson 1eca11a
allow providers to configure settings
mrsimpson c7284ca
First draft of runtime integration
mrsimpson 54d7d40
Configuration and lifecycle for search providers
mrsimpson a510bdc
Split Redlink and Smarti Search with common components
mrsimpson 7dedb69
Introduce phase model for easier hook handling
mrsimpson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM rocketchat/base:4 | ||
|
||
ENV RC_VERSION 0.59.0-develop | ||
ENV RC_VERSION 0.59.2 | ||
|
||
MAINTAINER buildmaster@rocket.chat | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Purpose | ||
This package provides options to enable full-text-search in Rocket.Chat | ||
|
||
# Implementation | ||
For integrating as loosely as possible, this package provides an implementation of the Rocket.Chat search interface. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { | ||
SearchProvider, | ||
searchProviders, | ||
SearchProviderMetadata, | ||
SearchProviderRuntimeIntegration, | ||
SearchProviderUi | ||
} from 'meteor/rocketchat:search'; | ||
|
||
export const SETTING_URL = 'RedlinkSearchUrl'; | ||
|
||
class RedlinkSearchProviderRuntimeIntegration extends SearchProviderRuntimeIntegration { | ||
|
||
} | ||
|
||
class RedlinkSearchProviderMetadata extends SearchProviderMetadata { | ||
supportsPermissions() { | ||
return true; | ||
} | ||
|
||
addSettings(section) { | ||
section.add(SETTING_URL, ''); | ||
} | ||
|
||
isConfigurationValid(settings, logger) { | ||
logger.debug('Validating settings', settings); | ||
if (!settings[SETTING_URL] || settings[SETTING_URL] === '') { | ||
return false; | ||
} | ||
} | ||
} | ||
|
||
/* | ||
Don't know whether an own UI is really necessary | ||
*/ | ||
class RedlinkSearchProviderUi extends SearchProviderUi { | ||
|
||
} | ||
|
||
class RedlinkSearchProvider extends SearchProvider { | ||
constructor() { | ||
super('redlink', new RedlinkSearchProviderRuntimeIntegration(), new RedlinkSearchProviderMetadata(), new RedlinkSearchProviderUi()); | ||
} | ||
} | ||
|
||
Meteor.startup(function() { | ||
searchProviders.add(new RedlinkSearchProvider()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Package.describe({ | ||
name: 'redlink:search', | ||
version: '0.0.1', | ||
summary: 'Full-text search for RocketChat - open source provided by Redlink', | ||
git: 'https://github.com/redlink-gmbh/rocket-search', | ||
documentation: 'README.md' | ||
}); | ||
|
||
Package.onUse(function(api) { | ||
api.versionsFrom('1.5.2.2'); | ||
api.use('ecmascript'); | ||
api.use('rocketchat:search'); | ||
|
||
api.addFiles('lib/SearchProvider.js'); | ||
|
||
api.mainModule('redlink-search.js'); | ||
}); | ||
|
||
/*Package.onTest(function(api) { | ||
api.use('ecmascript'); | ||
api.use('tinytest'); | ||
api.use('redlink:search'); | ||
});*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Write your package code here! | ||
|
||
// Variables exported by this module can be imported by other packages and | ||
// applications. See redlink-search-lib-tests.js for an example of importing. | ||
export const name = 'search-redlink'; |
52 changes: 27 additions & 25 deletions
52
packages/rocketchat-google-vision/.npm/package/npm-shrinkwrap.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"version": "0.59.0-develop" | ||
"version": "0.59.2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Purpose | ||
This package provides a framework and libraries for implementing a full-text-search inside Rocket.Chat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Transport object for a single result when searching for Rooms | ||
*/ | ||
export class RoomSearchResult { | ||
constructor(roomId, title, formattedExcerpt) { | ||
this.roomId = roomId; | ||
this.title = title; | ||
this.formattedExcerpt = formattedExcerpt; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import {SearchProviderRuntimeIntegration} from './SearchProviderRuntimeIntegration'; | ||
import {SearchProviderMetadata} from './SearchProviderMetadata'; | ||
import {SearchProviderUi} from './SearchProviderUi'; | ||
|
||
/** | ||
* A search provider is an implementation of a full-text-search within Rocket.Chat | ||
* As such, it is integrated during the search-relevant events at runtime. | ||
* It may provide own UI elements or re-use generic UI components | ||
*/ | ||
export class SearchProvider { | ||
constructor(identifier, runtimeIntegration, metadata, ui) { | ||
if (!(runtimeIntegration instanceof SearchProviderRuntimeIntegration)) { | ||
throw new Error('Invalid runtimeIntegration object, it must extend "SearchProviderRuntimeIntegration"'); | ||
} | ||
|
||
if (!(metadata instanceof SearchProviderMetadata)) { | ||
throw new Error('Invalid metadata object, it must extend "SearchProviderMetadata"'); | ||
} | ||
|
||
if (!(ui instanceof SearchProviderUi)) { | ||
throw new Error('Invalid ui object, it must extend "SearchProviderUi"'); | ||
} | ||
|
||
this._identifier = identifier; | ||
|
||
this._metadata = metadata; | ||
|
||
// restrict visibility of components to the tier they are used on | ||
if (Meteor.isServer) { | ||
this._runtimeIntegration = runtimeIntegration; | ||
} | ||
|
||
if (Meteor.isClient) { | ||
this._ui = ui; | ||
} | ||
} | ||
|
||
get identifier() { | ||
return this._identifier; | ||
} | ||
|
||
/* | ||
As an alternative to interfaces, we use composition in order to group features and methods | ||
*/ | ||
|
||
/** | ||
* Interface for integrating the search provider in the transaction process of executing Rocket.Chat | ||
* @return {SearchProviderRuntimeIntegration} | ||
*/ | ||
get runtimeIntegration() { | ||
return this._runtimeIntegration; | ||
} | ||
|
||
/** | ||
* Interface for retrieving infromatino about the search provider which are used for configuration of the provider | ||
* or for triggering switches in the caller | ||
* @return {SearchProviderMetadata} | ||
*/ | ||
get metadata() { | ||
return this._metadata; | ||
} | ||
|
||
/** | ||
* Interface for everything related to the user interface. This includes the actual UI components as well as all | ||
* kinds of text presented to the end-user | ||
* @return {SearchProviderUi} | ||
*/ | ||
get ui() { | ||
return this._ui; | ||
} | ||
|
||
/* | ||
The following methods are the actual core of the search | ||
*/ | ||
|
||
/** | ||
* Perform a full-text-search for rooms. The content which is searched may depend on the provider. | ||
* Potential sources are all properties handed over during replication | ||
* @param searchText The text as entered by the user. Caution: there's no escaping done by the consumer. Protection | ||
* for code injection needs to be performed by the implementaion | ||
* @param userId The technical GUID of the user who executed the seach. This allows for integration of an ACL | ||
* @param logger A logger providing log-levels {error, warn, info/log, debug, success} | ||
* @return {Array} //todo: Define format of the result instance | ||
*/ | ||
findRooms(searchText, userId, logger) { | ||
logger.debug('Search for rooms triggered by', userId, 'with search text', searchText); | ||
return []; | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If implemented what would this do beyond the settings exposed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geekgonecrazy there are usecases where a search provider has own capabilities, such as filtering, facetting, more-like-this, ...
A generic UI would have to be highly configurable in order to deal with all the different options - and it would be tricky to get all providers aligned.
In addition to that, not all provides might be able to integrate with blaze. In this case, they could provide an empty template with a unique selector and provide the UI from the external system (loaded lazily). This makes the provider independent from RC-releases as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@graywolf336 thoughts? 🔝 this is going to be important across various parts of rocketchat apps.
Also we don't want to count on blaze.... as we might be switching frameworks. So something agnostic would be best if this is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geekgonecrazy one more thing about that: many external systems (which are to be integrated) already bring some sort of UI. For search, there are plenty of libs. None of them is written in blaze. Thus, a template which loads the other technology‘s UI onCreated is at least something to consider. As you said: also for the RC apps. See https://github.com/assistify/Rocket.Chat/blob/develop/packages/assistify-ai/client/views/app/tabbar/smarti.js