@@ -8,43 +8,36 @@ export default {
|
||||
creator: entity.creator,
|
||||
added: entity.added,
|
||||
name: entity.name,
|
||||
//especially for ES because it doesn't allow to sort by not a keyword fields
|
||||
name_keyword: entity.name,
|
||||
company_id: entity.company_id,
|
||||
access_users: ["user_1234", "user_454"],
|
||||
access_users_x_initiator: ["user_1234_x_user_4343", "user_1234_x_user_4343"],
|
||||
|
||||
access_entities: [
|
||||
{
|
||||
type: "user",
|
||||
level: "read",
|
||||
target: "user_1234",
|
||||
source: "user_5678",
|
||||
},
|
||||
{
|
||||
type: "user",
|
||||
level: "read",
|
||||
target: "user_abcd",
|
||||
source: "user_5678",
|
||||
},
|
||||
],
|
||||
access_entities: entity.access_info?.entities?.filter(e => e.level != "none").map(e => e.id),
|
||||
last_modified: entity.last_modified,
|
||||
mime_type: entity.last_version_cache?.file_metadata?.mime,
|
||||
}),
|
||||
mongoMapping: {
|
||||
text: {
|
||||
content_keywords: "text",
|
||||
tags: "text",
|
||||
creator: "text",
|
||||
added: "text",
|
||||
name: "text",
|
||||
name_keyword: "text",
|
||||
company_id: "text",
|
||||
mime_type: "text",
|
||||
},
|
||||
},
|
||||
esMapping: {
|
||||
properties: {
|
||||
name: { type: "text", index_prefixes: { min_chars: 1 } },
|
||||
name_keyword: { type: "keyword" },
|
||||
content_keywords: { type: "text", index_prefixes: { min_chars: 1 } },
|
||||
tags: { type: "keyword" },
|
||||
creator: { type: "keyword" },
|
||||
added: { type: "keyword" },
|
||||
added: { type: "unsigned_long" },
|
||||
company_id: { type: "keyword" },
|
||||
access_entities: { type: "keyword" },
|
||||
mime_type: { type: "keyword" },
|
||||
last_modified: { type: "unsigned_long" },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -48,13 +48,13 @@ export class DriveFile {
|
||||
@Column("tags", "encoded_json")
|
||||
tags: string[];
|
||||
|
||||
@Type(() => String)
|
||||
@Column("added", "string")
|
||||
added: string;
|
||||
@Type(() => Number)
|
||||
@Column("added", "number")
|
||||
added: number;
|
||||
|
||||
@Type(() => String)
|
||||
@Column("last_modified", "string")
|
||||
last_modified: string;
|
||||
@Type(() => Number)
|
||||
@Column("last_modified", "number")
|
||||
last_modified: number;
|
||||
|
||||
@Column("access_info", "encoded_json")
|
||||
access_info: AccessInformation;
|
||||
|
||||
Reference in New Issue
Block a user