import { Database } from 'arangojs'; import { AnalyzerDescription, CreateAnalyzerOptions } from 'arangojs/analyzer'; import { ArangoSearchViewPropertiesOptions, CreateArangoSearchViewOptions, TierConsolidationPolicy, View, ViewProperties } from 'arangojs/view'; import { Model, RootEntityType } from '../../../model'; import { SchemaMigration } from './migrations'; export declare const FLEX_SEARCH_VIEW_PREFIX = "flex_view_"; export interface FlexSearchPrimarySortConfig { readonly field: string; readonly asc: boolean; } export interface ArangoSearchDefinition { readonly rootEntityType: RootEntityType; readonly viewName: string; readonly collectionName: string; readonly primarySort: ReadonlyArray; } export interface ArangoSearchConfiguration { readonly recursionDepth?: number; /** * The time in milliseconds after which data changes will be visible in flexSearch queries */ readonly commitIntervalMsec?: number; /** * The interval at which a consolidation policy is applied to the flexSearch view */ readonly consolidationIntervalMsec?: number; /** * Wait at least this many commits before removing unused files in the data directory */ readonly cleanupIntervalStep?: number; /** * Specify options of the consolidation policy. If not specified, new views will use defaults * and existing views will not be changed. */ readonly consolidationPolicy?: TierConsolidationPolicy; /** * In some cases, arangosearch cannot be updated but need to be recreated. By default, the view * is deleted first, then recreated. If this is true, the view is first created using a * temporary name, then the actual one is deleted, and the temporary is renamed to the actual * one. This reduces the downtime during the migration. * * Cannot be used if ArangoDB is running as a cluster (renaming views is not supported in * ArangoDB cluster deployments, see * https://docs.arangodb.com/3.11/develop/http-api/views/arangosearch-views/#rename-a-view) */ readonly useRenameStrategyToRecreate?: boolean; } export declare function getRequiredViewsFromModel(model: Model): ReadonlyArray; export declare function getFlexSearchViewNameForRootEntity(rootEntity: RootEntityType): string; export declare function calculateRequiredArangoSearchViewCreateOperations(existingViews: ReadonlyArray, requiredViews: ReadonlyArray, db: Database, configuration?: ArangoSearchConfiguration): Promise>; export declare function calculateRequiredArangoSearchViewDropOperations(views: ReadonlyArray, definitions: ReadonlyArray): ReadonlyArray; /** * Configures the inBackground flag * * We don't to this initially because it won't be present in the actual view definition, and we would always see a * pending change in the migration analyzer (because it would want to add inBackground). */ export declare function configureForBackgroundCreation(definition: T): T; export declare function isEqualProperties(definitionProperties: CreateArangoSearchViewOptions, viewProperties: ViewProperties): boolean; export declare function calculateRequiredArangoSearchViewUpdateOperations(views: ReadonlyArray, definitions: ReadonlyArray, db: Database, configuration?: ArangoSearchConfiguration): Promise>; export declare function areAnalyzersEqual(actual: AnalyzerDescription, target: CreateAnalyzerOptions): boolean;