27 lines
706 B
TypeScript
27 lines
706 B
TypeScript
import type { SearchIndexSchema } from "./types.js";
|
|
|
|
/**
|
|
* User directory (admin-only). Searchable by name and email but never
|
|
* indexes credentials, tokens or 2FA material.
|
|
*/
|
|
export const usersIndex: SearchIndexSchema = {
|
|
name: "users",
|
|
primaryKey: "id",
|
|
searchableAttributes: ["firstName", "lastName", "email"],
|
|
filterableAttributes: ["tenantId", "type", "admin", "active"],
|
|
sortableAttributes: ["createdAt", "lastLoginAt"],
|
|
rankingRules: ["words", "typo", "proximity", "attribute", "sort", "exactness"],
|
|
allowedDocumentFields: [
|
|
"id",
|
|
"tenantId",
|
|
"firstName",
|
|
"lastName",
|
|
"email",
|
|
"type",
|
|
"admin",
|
|
"active",
|
|
"createdAt",
|
|
"lastLoginAt",
|
|
],
|
|
};
|