mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 16:56:07 +00:00
UBERF-4428: Add option to disable indexing for a class (#4090)
Signed-off-by: Maxim Karmatskikh <mkarmatskih@gmail.com>
This commit is contained in:
parent
9b27f289cd
commit
8442e347a8
@ -335,4 +335,5 @@ export class TConfiguration extends TDoc implements Configuration {
|
||||
@MMixin(core.mixin.IndexConfiguration, core.class.Class)
|
||||
export class TIndexConfiguration<T extends Doc = Doc> extends TClass implements IndexingConfiguration<T> {
|
||||
indexes!: FieldIndex<T>[]
|
||||
searchDisabled!: boolean
|
||||
}
|
||||
|
@ -498,4 +498,5 @@ export type FieldIndex<T extends Doc> = {
|
||||
export interface IndexingConfiguration<T extends Doc> extends Class<Doc> {
|
||||
// Define a list of extra index definitions.
|
||||
indexes: (FieldIndex<T> | string)[]
|
||||
searchDisabled?: boolean
|
||||
}
|
||||
|
@ -102,9 +102,9 @@ export const contentStageId = 'cnt-v2b'
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const fieldStateId = 'fld-v8'
|
||||
export const fieldStateId = 'fld-v9'
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const fullTextPushStageId = 'fts-v5'
|
||||
export const fullTextPushStageId = 'fts-v6'
|
||||
|
@ -120,6 +120,13 @@ export function isClassIndexable (hierarchy: Hierarchy, c: Ref<Class<Doc>>): boo
|
||||
hierarchy.setClassifierProp(c, 'class_indexed', false)
|
||||
return false
|
||||
}
|
||||
|
||||
const indexMixin = hierarchy.classHierarchyMixin(c, core.mixin.IndexConfiguration)
|
||||
if (indexMixin?.searchDisabled !== undefined && indexMixin?.searchDisabled) {
|
||||
hierarchy.setClassifierProp(c, 'class_indexed', false)
|
||||
return false
|
||||
}
|
||||
|
||||
const attrs = getFullTextIndexableAttributes(hierarchy, c)
|
||||
for (const d of hierarchy.getDescendants(c)) {
|
||||
if (hierarchy.isMixin(d)) {
|
||||
|
Loading…
Reference in New Issue
Block a user