Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/38710-search-term-object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@objectstack/platform-objects': patch
'@objectstack/service-segmenter': patch
'@objectstack/spec': patch
'@objectstack/cli': patch
---

feat(platform-objects, service-segmenter): the 检索词条 object `sys_search_term`, the administrator's search words

Clause-②: yes
Metadata-protocol: none

`@objectstack/platform-objects` declares `sys_search_term` (检索词条, Search Term): one record per word an administrator adds to search, one set for the whole deployment (no organization column). Fields: `term`, `kind` (`word` custom word or `stop_word`), `purpose` (`knowledge`, `record_search` or `both`; default `knowledge`, the only one implemented), `knowledge_source` (one knowledge source; empty for every source), `enabled` (default on) and `note`. `term`, `kind`, `purpose` and `enabled` are the segmenter contract's `SegmenterEntry` one to one. The object is `system-data` with CSV import opted in, so New, Edit, Delete, Import, Export and record history are the platform's own; every operation, writes included, requires `manage_platform_settings`. A record that disables a platform word (年假, 脱密, 应急采购, …) is refused: those words live in the segmenter's read-only dictionary, so make one a stop word instead. A platform stop word can be disabled. The platform words move here as `PLATFORM_SEARCH_WORDS`, and the segmenter's `PLATFORM_WORDS` reads them, so the object and the service hold one list.

`@objectstack/service-segmenter`: `SegmenterServicePlugin` registers `sys_search_term` on the manifest service (`SEARCH_TERM_BUNDLE_ID`), with no Setup entry. Nothing reads the records yet: the knowledge service passes them to the segmenter in a later release, and the object gets its Setup entry then.

`@objectstack/spec` lists `sys_search_term` among the platform-provided object names. `@objectstack/cli` gives it a row in the organization-ownership inventory (no organization column to drop).
8 changes: 8 additions & 0 deletions packages/cli/src/utils/organization-ownership-inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,14 @@ export const ORGANIZATION_OWNERSHIP_INVENTORY: readonly InventoryEntry[] = [
`${CENSUS_MAIN}: systemFields.tenant: false; ${D7}: one row per knowledge source, whose index serves the ` +
'whole deployment, written by the knowledge service under the system context, never by organization',
},
{
object: 'sys_search_term',
census: PMAIN,
fate: 'column-drop',
citation:
`${CENSUS_MAIN}: systemFields.tenant: false; ${D7}: the administrator's search words, one set for the ` +
'whole deployment, written by platform administrators (manage_platform_settings), never by organization',
},
{ object: 'sys_scim_connection_credential', census: P1, fate: 'attribution', citation: `${D3_ORG_ROWS}; ${D10_SINGLE}`, anchors: [] },
{
object: 'sys_flow_credential',
Expand Down
4 changes: 4 additions & 0 deletions packages/platform-objects/scripts/i18n-extract.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ import {
SysWorkCalendar,
SysWorkCalendarException,
SysKnowledgeSyncState,
SysSearchTerm,
} from '../src/system/index.js';

// The built-in tasks and notes (`work/`): business objects every environment
Expand Down Expand Up @@ -376,6 +377,9 @@ const config: ObjectStackDefinition = defineStack({
// [ADR-0161] Registered by the knowledge service; its labels are served
// from this package's bundles, like `sys_job_queue`'s.
SysKnowledgeSyncState,
// [objectstack#38710] Registered by the segmenter service; its labels are
// served from this package's bundles, like `sys_knowledge_sync_state`'s.
SysSearchTerm,
SysTask,
SysNote,
] as any,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,57 @@ export const arObjects: NonNullable<TranslationData['objects']> = {
}
}
},
sys_search_term: {
label: "مصطلح البحث",
pluralLabel: "مصطلحات البحث",
description: "كلمات يضيفها المسؤول إلى البحث: كلمات مخصصة تبقى كاملة عند تقطيع السؤال، وكلمات توقف تُحذف منه. مجموعة واحدة للنشر بأكمله، فوق كلمات المنصة.",
fields: {
id: {
label: "ID"
},
term: {
label: "المصطلح",
help: "الكلمة نفسها، وتُقارن دون تمييز بين الأشكال كاملة العرض ونصف العرض ولا بين الأحرف الكبيرة والصغيرة، مثل 明规条款 أو OA审批. المصطلح الذي يحوي علامات ترقيم غير مسافة واحدة، مثل R&D أو 《员工手册》، لا يُعثر عليه أبدًا في سؤال."
},
kind: {
label: "النوع",
help: "كلمة مخصصة: تبقى كاملة أينما وردت في السؤال. كلمة توقف: تُحذف من المصطلحات التي يُقطّع إليها السؤال، وتُقارن كاملة.",
options: {
word: "كلمة مخصصة",
stop_word: "كلمة توقف"
}
},
purpose: {
label: "الغرض",
help: "عمليات البحث التي ينطبق عليها المصطلح. حاليًا يقطّع البحث في المعرفة وحده الأسئلة إلى كلمات؛ والبحث في السجلات محجوز.",
options: {
knowledge: "البحث في المعرفة",
record_search: "البحث في السجلات",
both: "كلاهما"
}
},
knowledge_source: {
label: "مصدر المعرفة",
help: "مصدر المعرفة الوحيد الذي ينطبق عليه المصطلح، باسمه كما يسميه مستدعوه: NAMESPACE-NAME لمصدر حزمة، والاسم المجرد خلاف ذلك. فارغ: كل مصادر المعرفة في النشر."
},
enabled: {
label: "مُفعّل",
help: "إيقاف: لا أثر للسجل، وكلمة التوقف المعطّلة التي تطابق كلمة توقف في المنصة تسحب تلك الكلمة. لا يمكن تعطيل كلمة من كلمات المنصة؛ اجعلها كلمة توقف بدلًا من ذلك."
},
note: {
label: "ملاحظة",
help: "سبب إضافة المصطلح، للمسؤول التالي."
}
},
_validations: {
search_term_no_edge_space: {
message: "لا يمكن أن يبدأ المصطلح أو ينتهي بمسافة."
},
search_term_platform_word_not_disabled: {
message: "هذا المصطلح من كلمات المنصة ولا يمكن تعطيله. لكي لا يُبحث عنه، اجعله كلمة توقف."
}
}
},
sys_task: {
label: "مهمة",
pluralLabel: "المهام",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export const arGeneratedSourceHashes: Readonly<Record<string, string>> = {
"objects.sys_oauth_application.fields.jwks.label": "b2cf79f9d66c0dbc",
"objects.sys_oauth_application.fields.jwks_uri.label": "2a4339df734ab269",
"objects.sys_platform_setting_audit.fields.source.options.api": "4baeeff968e192d1",
"objects.sys_search_term.fields.id.label": "00b0385c9c152888",
"objects.sys_setting_audit.fields.source.options.api": "4baeeff968e192d1",
"objects.sys_sso_provider._actions.edit_oidc_provider.params.scopes.placeholder": "58ac90cde28c764d",
"objects.sys_sso_provider._actions.edit_saml_provider.params.logoutUrl.helpText": "e12c82bcc5ee4470",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const OWNED_OBJECTS = new Set([
'sys_job', 'sys_job_run', 'sys_job_queue', 'sys_import_job',
// knowledge — each source's sync state (declared here, registered by the knowledge service)
'sys_knowledge_sync_state',
// search — the administrator's search words (declared here, registered by the segmenter service)
'sys_search_term',
// metadata (sys_view_definition retired as inert, ADR-0131 D13)
'sys_metadata', 'sys_metadata_history', 'sys_metadata_audit', 'sys_metadata_commit',
// system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,57 @@ export const deObjects: NonNullable<TranslationData['objects']> = {
}
}
},
sys_search_term: {
label: "Suchbegriff",
pluralLabel: "Suchbegriffe",
description: "Wörter, die ein Administrator der Suche hinzufügt: eigene Wörter, die beim Zerlegen einer Frage ganz bleiben, und Stoppwörter, die daraus entfernt werden. Ein Satz für die gesamte Bereitstellung, über den Plattformwörtern.",
fields: {
id: {
label: "ID"
},
term: {
label: "Begriff",
help: "Das Wort, verglichen ohne Unterscheidung von voller oder halber Breite und Groß-/Kleinschreibung, etwa 明规条款 oder OA审批. Ein Begriff mit anderen Satzzeichen als einem einzelnen Leerzeichen, etwa R&D oder 《员工手册》, wird in einer Frage nie gefunden."
},
kind: {
label: "Art",
help: "Eigenes Wort: bleibt ganz, wo immer die Frage es schreibt. Stoppwort: wird aus den Begriffen einer zerlegten Frage entfernt, als Ganzes verglichen.",
options: {
word: "Eigenes Wort",
stop_word: "Stoppwort"
}
},
purpose: {
label: "Zweck",
help: "Die Suchen, für die der Begriff gilt. Derzeit zerlegt nur die Wissenssuche Fragen in Wörter; die Datensatzsuche ist reserviert.",
options: {
knowledge: "Wissenssuche",
record_search: "Datensatzsuche",
both: "Beide"
}
},
knowledge_source: {
label: "Wissensquelle",
help: "Die eine Wissensquelle, für die der Begriff gilt, so benannt wie von ihren Aufrufern: NAMESPACE-NAME für die Quelle eines Pakets, sonst der bloße Name. Leer: alle Wissensquellen der Bereitstellung."
},
enabled: {
label: "Aktiviert",
help: "Aus: Der Datensatz wirkt nicht, und ein deaktiviertes Stoppwort mit demselben Begriff wie ein Plattform-Stoppwort zieht dieses Stoppwort zurück. Ein Plattformwort kann nicht deaktiviert werden; machen Sie es stattdessen zu einem Stoppwort."
},
note: {
label: "Notiz",
help: "Warum der Begriff hinzugefügt wurde, für den nächsten Administrator."
}
},
_validations: {
search_term_no_edge_space: {
message: "Ein Begriff darf nicht mit einem Leerzeichen beginnen oder enden."
},
search_term_platform_word_not_disabled: {
message: "Dieser Begriff ist ein Plattformwort und kann nicht deaktiviert werden. Damit er nicht gesucht wird, machen Sie ihn zu einem Stoppwort."
}
}
},
sys_task: {
label: "Aufgabe",
pluralLabel: "Aufgaben",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export const deGeneratedSourceHashes: Readonly<Record<string, string>> = {
"objects.sys_scim_subject.fields.id.label": "00b0385c9c152888",
"objects.sys_scim_subject.fields.revision.label": "9736a257b7ba380b",
"objects.sys_scim_user.fields.id.label": "00b0385c9c152888",
"objects.sys_search_term.fields.id.label": "00b0385c9c152888",
"objects.sys_secret.fields.id.label": "00b0385c9c152888",
"objects.sys_secret.fields.namespace.label": "eca03ee21fc17d64",
"objects.sys_secret.fields.version.label": "b74a37c0879ec50e",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,57 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
}
}
},
sys_search_term: {
label: "Search Term",
pluralLabel: "Search Terms",
description: "Words an administrator adds to search: custom words a question is cut to keep whole, and stop words dropped from it. One set for the whole deployment, layered over the platform words.",
fields: {
id: {
label: "ID"
},
term: {
label: "Term",
help: "The word, compared without regard to full-width or half-width forms or to case, such as 明规条款 or OA审批. A term holding punctuation other than a single space, such as R&D or 《员工手册》, is never found in a question."
},
kind: {
label: "Kind",
help: "Custom Word: kept whole wherever a question spells it. Stop Word: dropped from the terms a question is cut into, compared whole.",
options: {
word: "Custom Word",
stop_word: "Stop Word"
}
},
purpose: {
label: "Purpose",
help: "The searches the term applies to. Only knowledge retrieval cuts questions into words today; record search is reserved.",
options: {
knowledge: "Knowledge Retrieval",
record_search: "Record Search",
both: "Both"
}
},
knowledge_source: {
label: "Knowledge Source",
help: "The one knowledge source the term applies to, as callers name it: NAMESPACE-NAME for a package's source, the bare name otherwise. Empty: every knowledge source of the deployment."
},
enabled: {
label: "Enabled",
help: "Off: the record has no effect, and a disabled stop word of the same term as a platform stop word withdraws that stop word. A platform word cannot be disabled; make it a stop word instead."
},
note: {
label: "Note",
help: "Why the term was added, for the next administrator."
}
},
_validations: {
search_term_no_edge_space: {
message: "A term cannot start or end with a space."
},
search_term_platform_word_not_disabled: {
message: "This term is a platform word and cannot be disabled. To stop it from being searched, make it a stop word instead."
}
}
},
sys_task: {
label: "Task",
pluralLabel: "Tasks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,57 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
}
}
},
sys_search_term: {
label: "Término de búsqueda",
pluralLabel: "Términos de búsqueda",
description: "Palabras que un administrador añade a la búsqueda: palabras personalizadas que se conservan enteras al dividir una pregunta y palabras vacías que se eliminan de ella. Un único conjunto para toda la implementación, superpuesto a las palabras de la plataforma.",
fields: {
id: {
label: "ID"
},
term: {
label: "Término",
help: "La palabra, comparada sin distinguir formas de ancho completo o medio ni mayúsculas, como 明规条款 u OA审批. Un término que contiene puntuación distinta de un único espacio, como R&D o 《员工手册》, nunca se encuentra en una pregunta."
},
kind: {
label: "Tipo",
help: "Palabra personalizada: se conserva entera dondequiera que la pregunta la escriba. Palabra vacía: se elimina de los términos en que se divide la pregunta, comparada entera.",
options: {
word: "Palabra personalizada",
stop_word: "Palabra vacía"
}
},
purpose: {
label: "Finalidad",
help: "Las búsquedas a las que se aplica el término. Hoy solo la recuperación de conocimiento divide las preguntas en palabras; la búsqueda de registros está reservada.",
options: {
knowledge: "Recuperación de conocimiento",
record_search: "Búsqueda de registros",
both: "Ambas"
}
},
knowledge_source: {
label: "Fuente de conocimiento",
help: "La única fuente de conocimiento a la que se aplica el término, tal como la nombran quienes la llaman: NAMESPACE-NAME para la fuente de un paquete, el nombre sin más en otro caso. Vacío: todas las fuentes de conocimiento de la implementación."
},
enabled: {
label: "Habilitado",
help: "Desactivado: el registro no tiene efecto, y una palabra vacía desactivada con el mismo término que una palabra vacía de la plataforma retira esa palabra vacía. Una palabra de la plataforma no se puede desactivar; conviértala en palabra vacía."
},
note: {
label: "Nota",
help: "Por qué se añadió el término, para el próximo administrador."
}
},
_validations: {
search_term_no_edge_space: {
message: "Un término no puede empezar ni terminar con un espacio."
},
search_term_platform_word_not_disabled: {
message: "Este término es una palabra de la plataforma y no se puede desactivar. Para que no se busque, conviértalo en palabra vacía."
}
}
},
sys_task: {
label: "Tarea",
pluralLabel: "Tareas",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const esESGeneratedSourceHashes: Readonly<Record<string, string>> = {
"objects.sys_scim_projection_grant.fields.id.label": "00b0385c9c152888",
"objects.sys_scim_subject.fields.id.label": "00b0385c9c152888",
"objects.sys_scim_user.fields.id.label": "00b0385c9c152888",
"objects.sys_search_term.fields.id.label": "00b0385c9c152888",
"objects.sys_secret.fields.id.label": "00b0385c9c152888",
"objects.sys_setting_audit.fields.actor_id.label": "b155813f8a7f06e3",
"objects.sys_setting_audit.fields.id.label": "00b0385c9c152888",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,57 @@ export const frObjects: NonNullable<TranslationData['objects']> = {
}
}
},
sys_search_term: {
label: "Terme de recherche",
pluralLabel: "Termes de recherche",
description: "Mots qu’un administrateur ajoute à la recherche : des mots personnalisés conservés entiers lors du découpage d’une question, et des mots vides qui en sont retirés. Un seul ensemble pour tout le déploiement, superposé aux mots de la plateforme.",
fields: {
id: {
label: "ID"
},
term: {
label: "Terme",
help: "Le mot, comparé sans distinguer les formes pleine chasse ou demi-chasse ni la casse, comme 明规条款 ou OA审批. Un terme contenant une ponctuation autre qu’une espace simple, comme R&D ou 《员工手册》, n’est jamais trouvé dans une question."
},
kind: {
label: "Type",
help: "Mot personnalisé : conservé entier partout où la question l’écrit. Mot vide : retiré des termes en lesquels la question est découpée, comparé en entier.",
options: {
word: "Mot personnalisé",
stop_word: "Mot vide"
}
},
purpose: {
label: "Usage",
help: "Les recherches auxquelles le terme s’applique. Aujourd’hui, seule la recherche de connaissances découpe les questions en mots ; la recherche d’enregistrements est réservée.",
options: {
knowledge: "Recherche de connaissances",
record_search: "Recherche d’enregistrements",
both: "Les deux"
}
},
knowledge_source: {
label: "Source de connaissances",
help: "L’unique source de connaissances à laquelle le terme s’applique, telle que ses appelants la nomment : NAMESPACE-NAME pour la source d’un paquet, le nom seul sinon. Vide : toutes les sources de connaissances du déploiement."
},
enabled: {
label: "Activé",
help: "Désactivé : l’enregistrement n’a aucun effet, et un mot vide désactivé portant le même terme qu’un mot vide de la plateforme retire ce mot vide. Un mot de la plateforme ne peut pas être désactivé ; faites-en plutôt un mot vide."
},
note: {
label: "Note",
help: "Pourquoi le terme a été ajouté, pour le prochain administrateur."
}
},
_validations: {
search_term_no_edge_space: {
message: "Un terme ne peut pas commencer ni se terminer par une espace."
},
search_term_platform_word_not_disabled: {
message: "Ce terme est un mot de la plateforme et ne peut pas être désactivé. Pour qu’il ne soit plus recherché, faites-en un mot vide."
}
}
},
sys_task: {
label: "Tâche",
pluralLabel: "Tâches",
Expand Down
Loading
Loading