nodebb-plugin-dbsearch 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-dbsearch",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "A Plugin that lets users search posts and topics",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "BSD-2-Clause",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"lodash": "4.17.21",
|
|
22
|
-
"redisearch": "^1.0.
|
|
22
|
+
"redisearch": "^1.0.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"eslint": "7.32.0",
|
package/public/admin.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
define('admin/plugins/dbsearch', [
|
|
3
|
+
define('admin/plugins/dbsearch', [
|
|
4
|
+
'alerts', 'admin/settings',
|
|
5
|
+
], function (alerts, settings) {
|
|
4
6
|
var dbsearch = {};
|
|
5
7
|
var intervalId = 0;
|
|
6
8
|
|
|
@@ -21,7 +23,7 @@ define('admin/plugins/dbsearch', ['alerts'], function (alerts) {
|
|
|
21
23
|
excludeCategories: $('#exclude-categories').val(),
|
|
22
24
|
}, function (data) {
|
|
23
25
|
if (typeof data === 'string') {
|
|
24
|
-
|
|
26
|
+
settings.toggleSaveSuccess($('#save'));
|
|
25
27
|
}
|
|
26
28
|
});
|
|
27
29
|
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const winston = require.main.require('winston');
|
|
5
|
-
const db = module.parent.require('./database');
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
name: 'Changing dbsearch mongodb search schema to use _id',
|
|
9
|
-
timestamp: Date.UTC(2018, 10, 26),
|
|
10
|
-
method: async function () {
|
|
11
|
-
const nconf = require.main.require('nconf');
|
|
12
|
-
const isMongo = nconf.get('database') === 'mongo';
|
|
13
|
-
if (!isMongo) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const plugin = require('../lib/dbsearch');
|
|
18
|
-
await db.client.collection('searchtopic').deleteMany({});
|
|
19
|
-
await db.client.collection('searchpost').deleteMany({});
|
|
20
|
-
try {
|
|
21
|
-
await db.client.collection('searchtopic').dropIndex({ id: 1 });
|
|
22
|
-
await db.client.collection('searchpost').dropIndex({ id: 1 });
|
|
23
|
-
} catch (err) {
|
|
24
|
-
winston.error(err.stack);
|
|
25
|
-
}
|
|
26
|
-
await plugin.reindex();
|
|
27
|
-
},
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const winston = require.main.require('winston');
|
|
5
|
+
const db = module.parent.require('./database');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
name: 'Changing dbsearch mongodb search schema to use _id',
|
|
9
|
+
timestamp: Date.UTC(2018, 10, 26),
|
|
10
|
+
method: async function () {
|
|
11
|
+
const nconf = require.main.require('nconf');
|
|
12
|
+
const isMongo = nconf.get('database') === 'mongo';
|
|
13
|
+
if (!isMongo) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const plugin = require('../lib/dbsearch');
|
|
18
|
+
await db.client.collection('searchtopic').deleteMany({});
|
|
19
|
+
await db.client.collection('searchpost').deleteMany({});
|
|
20
|
+
try {
|
|
21
|
+
await db.client.collection('searchtopic').dropIndex({ id: 1 });
|
|
22
|
+
await db.client.collection('searchpost').dropIndex({ id: 1 });
|
|
23
|
+
} catch (err) {
|
|
24
|
+
winston.error(err.stack);
|
|
25
|
+
}
|
|
26
|
+
await plugin.reindex();
|
|
27
|
+
},
|
|
28
28
|
};
|