@tachybase/plugin-full-text-search 1.6.21 → 1.6.23
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/dist/externalVersion.js +2 -3
- package/dist/server/dialects/FieldBase.d.ts +4 -3
- package/dist/server/dialects/FieldBase.js +2 -3
- package/dist/server/dialects/FieldMariadb.d.ts +1 -1
- package/dist/server/dialects/FieldPostgres.d.ts +1 -1
- package/dist/server/dialects/FieldPostgres.js +1 -2
- package/dist/server/dialects/FieldSqlite.d.ts +1 -2
- package/package.json +5 -5
package/dist/externalVersion.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Collection } from '@tego/server';
|
|
2
|
-
import { WhereOptions } from 'sequelize';
|
|
1
|
+
import { Collection, type WhereOptions } from '@tego/server';
|
|
3
2
|
import { handleFieldParams } from '../types';
|
|
4
3
|
type NestedRecord<T, K extends string> = K extends `${infer Head}.${infer Tail}` ? {
|
|
5
4
|
[Key in Head]: NestedRecord<T, Tail>;
|
|
@@ -20,7 +19,9 @@ export declare class FieldBase {
|
|
|
20
19
|
getMultiSelectFilter(rawField: string, matchEnum: string[]): WhereOptions<any>;
|
|
21
20
|
array(params: handleFieldParams): WhereOptions<any>;
|
|
22
21
|
private getMatchEnum;
|
|
23
|
-
protected getCollectionField(fieldName: string, collection: Collection, collectionName?: string):
|
|
22
|
+
protected getCollectionField(fieldName: string, collection: Collection, collectionName?: string): {
|
|
23
|
+
col: string;
|
|
24
|
+
};
|
|
24
25
|
protected getCollectionFieldColName(fieldName: string, collection: Collection, collectionName?: string): string;
|
|
25
26
|
}
|
|
26
27
|
export {};
|
|
@@ -21,7 +21,6 @@ __export(FieldBase_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(FieldBase_exports);
|
|
23
23
|
var import_server = require("@tego/server");
|
|
24
|
-
var import_sequelize = require("sequelize");
|
|
25
24
|
var import_utils = require("../utils");
|
|
26
25
|
class FieldBase {
|
|
27
26
|
constructor() {
|
|
@@ -119,9 +118,9 @@ class FieldBase {
|
|
|
119
118
|
rawFieldName = ((_a = collection.model.rawAttributes[fieldName]) == null ? void 0 : _a.field) || fieldName;
|
|
120
119
|
}
|
|
121
120
|
if (!collectionName) {
|
|
122
|
-
return (0,
|
|
121
|
+
return (0, import_server.col)(rawFieldName);
|
|
123
122
|
}
|
|
124
|
-
return (0,
|
|
123
|
+
return (0, import_server.col)(`${collectionName}.${rawFieldName}`);
|
|
125
124
|
}
|
|
126
125
|
getCollectionFieldColName(fieldName, collection, collectionName) {
|
|
127
126
|
return this.getCollectionField(fieldName, collection, collectionName).col;
|
|
@@ -21,7 +21,6 @@ __export(FieldPostgres_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(FieldPostgres_exports);
|
|
23
23
|
var import_server = require("@tego/server");
|
|
24
|
-
var import_sequelize = require("sequelize");
|
|
25
24
|
var import_utils = require("../utils");
|
|
26
25
|
var import_FieldBase = require("./FieldBase");
|
|
27
26
|
class FieldPostgres extends import_FieldBase.FieldBase {
|
|
@@ -83,7 +82,7 @@ class FieldPostgres extends import_FieldBase.FieldBase {
|
|
|
83
82
|
return {
|
|
84
83
|
[import_server.Op.and]: [
|
|
85
84
|
(0, import_server.where)(
|
|
86
|
-
(0,
|
|
85
|
+
(0, import_server.literal)(`CAST(${this.getCollectionFieldColName(field, collection, collectionName)} AS TEXT)`),
|
|
87
86
|
// 确保不加引号,直接插入 SQL 表达式
|
|
88
87
|
{
|
|
89
88
|
[import_server.Op.like]: `%${(0, import_utils.escapeLike)(keyword)}%`
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Op } from '@tego/server';
|
|
2
|
-
import { WhereOptions } from 'sequelize';
|
|
1
|
+
import { Op, type WhereOptions } from '@tego/server';
|
|
3
2
|
import { handleFieldParams } from '../types';
|
|
4
3
|
import { FieldBase } from './FieldBase';
|
|
5
4
|
export declare class FieldSqlite extends FieldBase {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-full-text-search",
|
|
3
3
|
"displayName": "Full-text Search",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.23",
|
|
5
5
|
"description": "Provides full text search capability",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"System management"
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "dist/server/index.js",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@tachybase/test": "1.6.
|
|
21
|
-
"@tego/client": "1.6.
|
|
22
|
-
"@tego/server": "1.6.
|
|
20
|
+
"@tachybase/test": "1.6.16",
|
|
21
|
+
"@tego/client": "1.6.16",
|
|
22
|
+
"@tego/server": "1.6.16",
|
|
23
23
|
"@types/sequelize": "^4.28.20",
|
|
24
24
|
"antd": "5.22.5",
|
|
25
25
|
"lodash": "4.17.21",
|
|
26
26
|
"sequelize": "6.37.5",
|
|
27
|
-
"@tachybase/client": "1.6.
|
|
27
|
+
"@tachybase/client": "1.6.23"
|
|
28
28
|
},
|
|
29
29
|
"description.zh-CN": "提供全字段搜索能力",
|
|
30
30
|
"displayName.zh-CN": "全文搜索"
|