Skip to content

Commit 4f41abd

Browse files
authored
Revert "Create pattern blob for indexing (#2060)" (#2061)
This reverts commit 4463468. Not the issue... reversion of #2060 and post #2048
1 parent 4463468 commit 4f41abd

3 files changed

Lines changed: 2 additions & 17 deletions

File tree

controllers/scriptStorage.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,8 +2062,6 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
20622062
var now = null;
20632063

20642064
var storeDescriptionLength = null;
2065-
var includes = null;
2066-
var matches = null;
20672065

20682066
if (aRemoved) {
20692067
aCallback(new statusError({
@@ -2087,8 +2085,6 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
20872085
// New script
20882086
now = new Date();
20892087

2090-
includes = findMeta(aMeta, 'UserScript.include.value');
2091-
matches = findMeta(aMeta, 'UserScript.match.value');
20922088

20932089
storeDescriptionLength = settings.scriptSearchQueryStoreMaxDescription;
20942090
storeDescriptionLength = rLogographic.test(thisDescription)
@@ -2115,8 +2111,6 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
21152111
installName: installName,
21162112
fork: null,
21172113
meta: aMeta,
2118-
_pattern: ((includes ? includes.join(' ') : '') + ' '
2119-
+ (matches ? matches.join(' ') : '')).trim(),
21202114
isLib: isLib,
21212115
uses: isLib ? null : libraries,
21222116
_authorId: aUser._id
@@ -2153,13 +2147,6 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
21532147
: ''
21542148
);
21552149
aScript.meta = aMeta;
2156-
2157-
includes = findMeta(aMeta, 'UserScript.include.value');
2158-
matches = findMeta(aMeta, 'UserScript.match.value');
2159-
2160-
aScript._pattern = ((includes ? includes.join(' ') : '') + ' '
2161-
+ (matches ? matches.join(' ') : '')).trim()
2162-
21632150
aScript.uses = libraries;
21642151

21652152
// Okay to update

libs/modelQuery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ var parseScriptSearchQuery = function (aScriptListQuery, aQuery, aLimited) {
125125
});
126126
} else {
127127
parseModelListSearchQuery(aScriptListQuery, aQuery, {
128-
partialWordMatchFields: ['name', 'author', '_description', '_about'],
129-
fullWordMatchFields: ['_pattern']
128+
partialWordMatchFields: ['name', '_description', 'author', '_about' ],
129+
fullWordMatchFields: ['meta.UserScript.include.value', 'meta.UserScript.match.value']
130130
});
131131
}
132132
};

models/script.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ var scriptSchema = new Schema({
1515
// Visible
1616
name: String,
1717
_description: String,
18-
_pattern: String,
1918
author: String,
2019
installs: { type: Number, default: 0 },
2120
installsSinceUpdate: { type: Number, default: 0 },
@@ -55,7 +54,6 @@ scriptSchema.index({
5554
isLib: 1,
5655
name: 1,
5756
author: 1,
58-
_pattern: 1,
5957
_description: 1,
6058
_about: 1
6159
});

0 commit comments

Comments
 (0)