import { ApiSearchIndexSuccessfulAnalysis } from '@cbjsdev/http-client'; import { BucketName, CouchbaseClusterTypes, ScopeName } from '@cbjsdev/shared'; import { Cluster } from './cluster.js'; import { AllowSearchQueryingOptions, AnalyzeSearchDocumentOptions, DisallowSearchQueryingOptions, DropSearchIndexOptions, FreezeSearchPlanOptions, GetAllSearchIndexesOptions, GetSearchIndexedDocumentsCountOptions, GetSearchIndexOptions, ISearchIndex, PauseSearchIngestOptions, ResumeSearchIngestOptions, SearchIndex, UnfreezeSearchPlanOptions, UpsertSearchIndexOptions } from './searchindexmanager.js'; import { NodeCallback, VoidNodeCallback } from './utilities.js'; /** * SearchIndexManager provides an interface for managing the * search indexes on the cluster. * * @category Management */ export declare class ScopeSearchIndexManager = BucketName, in out S extends ScopeName = ScopeName> { private _cluster; private _bucketName; private _scopeName; /** * @internal */ constructor(cluster: Cluster, bucketName: B, scopeName: S); /** * Returns an index by it's name. * * @param indexName The index to retrieve. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ getIndex(indexName: string, options: GetSearchIndexOptions, callback?: NodeCallback): Promise; getIndex(indexName: string, callback?: NodeCallback): Promise; /** * Returns a list of all existing indexes. * * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ getAllIndexes(options: GetAllSearchIndexesOptions, callback?: NodeCallback): Promise; getAllIndexes(callback?: NodeCallback): Promise; /** * Creates or updates an existing index. * * @param indexDefinition The index to update. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ upsertIndex(indexDefinition: ISearchIndex, options: UpsertSearchIndexOptions, callback?: VoidNodeCallback): Promise; upsertIndex(indexDefinition: ISearchIndex, callback?: VoidNodeCallback): Promise; /** * Drops an index. * * @param indexName The name of the index to drop. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ dropIndex(indexName: string, options: DropSearchIndexOptions, callback?: VoidNodeCallback): Promise; dropIndex(indexName: string, callback?: VoidNodeCallback): Promise; /** * Returns the number of documents that have been indexed. * * @param indexName The name of the index to return the count for. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ getIndexedDocumentsCount(indexName: string, options: GetSearchIndexedDocumentsCountOptions, callback?: NodeCallback): Promise; getIndexedDocumentsCount(indexName: string, callback?: NodeCallback): Promise; /** * Pauses the ingestion of documents into an index. * * @param indexName The name of the index to pause. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ pauseIngest(indexName: string, options: PauseSearchIngestOptions, callback?: VoidNodeCallback): Promise; pauseIngest(indexName: string, callback?: VoidNodeCallback): Promise; /** * Resumes the ingestion of documents into an index. * * @param indexName The name of the index to resume. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ resumeIngest(indexName: string, options: ResumeSearchIngestOptions, callback?: VoidNodeCallback): Promise; resumeIngest(indexName: string, callback?: VoidNodeCallback): Promise; /** * Enables querying of an index. * * @param indexName The name of the index to enable querying for. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ allowQuerying(indexName: string, options: AllowSearchQueryingOptions, callback?: VoidNodeCallback): Promise; allowQuerying(indexName: string, callback?: VoidNodeCallback): Promise; /** * Disables querying of an index. * * @param indexName The name of the index to disable querying for. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ disallowQuerying(indexName: string, options: DisallowSearchQueryingOptions, callback?: VoidNodeCallback): Promise; disallowQuerying(indexName: string, callback?: VoidNodeCallback): Promise; /** * Freezes the indexing plan for execution of queries. * * @param indexName The name of the index to freeze the plan of. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ freezePlan(indexName: string, options: FreezeSearchPlanOptions, callback?: VoidNodeCallback): Promise; freezePlan(indexName: string, callback?: VoidNodeCallback): Promise; /** * Unfreezes the indexing plan for execution of queries. * * @param indexName The name of the index to freeze the plan of. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ unfreezePlan(indexName: string, options: UnfreezeSearchPlanOptions, callback?: VoidNodeCallback): Promise; unfreezePlan(indexName: string, callback?: VoidNodeCallback): Promise; /** * Performs analysis of a specific document by an index. * * @param indexName The name of the index to use for the analysis. * @param document The document to analyze. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ analyzeDocument(indexName: string, document: unknown, options: AnalyzeSearchDocumentOptions, callback?: NodeCallback): Promise; analyzeDocument(indexName: string, document: unknown, callback?: NodeCallback): Promise; }