Skip to content

Commit

Permalink
Revert "Create pattern blob for indexing (#2060)" (#2061)
Browse files Browse the repository at this point in the history
This reverts commit 4463468.

Not the issue... reversion of #2060 and post #2048
  • Loading branch information
Martii authored Mar 4, 2025
1 parent 4463468 commit 4f41abd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
13 changes: 0 additions & 13 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2062,8 +2062,6 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
var now = null;

var storeDescriptionLength = null;
var includes = null;
var matches = null;

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

includes = findMeta(aMeta, 'UserScript.include.value');
matches = findMeta(aMeta, 'UserScript.match.value');

storeDescriptionLength = settings.scriptSearchQueryStoreMaxDescription;
storeDescriptionLength = rLogographic.test(thisDescription)
Expand All @@ -2115,8 +2111,6 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
installName: installName,
fork: null,
meta: aMeta,
_pattern: ((includes ? includes.join(' ') : '') + ' '
+ (matches ? matches.join(' ') : '')).trim(),
isLib: isLib,
uses: isLib ? null : libraries,
_authorId: aUser._id
Expand Down Expand Up @@ -2153,13 +2147,6 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
: ''
);
aScript.meta = aMeta;

includes = findMeta(aMeta, 'UserScript.include.value');
matches = findMeta(aMeta, 'UserScript.match.value');

aScript._pattern = ((includes ? includes.join(' ') : '') + ' '
+ (matches ? matches.join(' ') : '')).trim()

aScript.uses = libraries;

// Okay to update
Expand Down
4 changes: 2 additions & 2 deletions libs/modelQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ var parseScriptSearchQuery = function (aScriptListQuery, aQuery, aLimited) {
});
} else {
parseModelListSearchQuery(aScriptListQuery, aQuery, {
partialWordMatchFields: ['name', 'author', '_description', '_about'],
fullWordMatchFields: ['_pattern']
partialWordMatchFields: ['name', '_description', 'author', '_about' ],
fullWordMatchFields: ['meta.UserScript.include.value', 'meta.UserScript.match.value']
});
}
};
Expand Down
2 changes: 0 additions & 2 deletions models/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var scriptSchema = new Schema({
// Visible
name: String,
_description: String,
_pattern: String,
author: String,
installs: { type: Number, default: 0 },
installsSinceUpdate: { type: Number, default: 0 },
Expand Down Expand Up @@ -55,7 +54,6 @@ scriptSchema.index({
isLib: 1,
name: 1,
author: 1,
_pattern: 1,
_description: 1,
_about: 1
});
Expand Down

0 comments on commit 4f41abd

Please sign in to comment.