///
///
import type { SearchIndexManagementBackend, SearchIndexRequest } from '../backends';
import { ISearchIndex, SearchIndex } from '../searchindexmanager';
import type { Index__Output as IndexPb } from './generated/couchbase/admin/search/v1/Index';
import type { SearchAdminServiceClient } from './generated/couchbase/admin/search/v1/SearchAdminService';
import type { Couchbase2Channel, Couchbase2Op } from './requestcontext';
/**
* @internal
*/
export declare const SEARCH_INDEX_GET: Couchbase2Op;
/**
* @internal
*/
export declare const SEARCH_INDEX_GET_ALL: Couchbase2Op;
/**
* @internal
*/
export declare const SEARCH_INDEX_UPSERT: Couchbase2Op;
/**
* @internal
*/
export declare const SEARCH_INDEX_DROP: Couchbase2Op;
/**
* @internal
*/
export declare const SEARCH_INDEX_GET_DOCUMENTS_COUNT: Couchbase2Op;
/**
* The control ops leave the index in the state they name, so each may be
* sent any number of times.
*
* @internal
*/
export declare const SEARCH_INDEX_CONTROL_INGEST: Couchbase2Op;
/**
* @internal
*/
export declare const SEARCH_INDEX_CONTROL_QUERY: Couchbase2Op;
/**
* @internal
*/
export declare const SEARCH_INDEX_CONTROL_PLAN_FREEZE: Couchbase2Op;
/**
* @internal
*/
export declare const SEARCH_INDEX_ANALYZE_DOCUMENT: Couchbase2Op;
/**
* The bucket and scope fields every request of the service carries.
*
* @internal
*/
export interface SearchScopePb {
/**
* The bucket of a scope's index, left out for the cluster's own.
*/
bucket_name?: string;
/**
* The scope of a scope's index, left out for the cluster's own.
*/
scope_name?: string;
}
/**
* The fields a create or an update carries for one index definition.
*
* @internal
*/
export interface IndexFieldsPb {
/**
* The index's name.
*/
name: string;
/**
* The index's type, such as `fulltext-index`.
*/
type: string;
/**
* The source's name, left out when the definition gives none.
*/
source_name?: string;
/**
* The source's type, left out when the definition gives none.
*/
source_type?: string;
/**
* The source's uuid, left out when the definition gives none.
*/
source_uuid?: string;
/**
* The index params, one entry per member.
*/
params: Record;
/**
* The plan params, one entry per member.
*/
plan_params: Record;
/**
* The source params, one entry per member.
*/
source_params: Record;
}
/**
* A scope's manager names its bucket and scope; the cluster's names
* neither, which the gateway reads as an index of the cluster's own.
*
* @internal
*/
export declare function searchScopeToProto(req: SearchIndexRequest): SearchScopePb;
/**
* A member with no JSON form is left out, as a classic connection leaves it
* out of the whole object. Params that are not an object are refused.
*
* @internal
*/
export declare function paramsToProto(params: unknown, what: string): Record;
/**
* The fields of `index` that a create and an update share. Neither
* carries the uuid here: only an update has one, and the caller sets it.
*
* @internal
*/
export declare function indexFieldsToProto(index: ISearchIndex): IndexFieldsPb;
/**
* One index the gateway sent back, as a classic connection reads it: a
* field the gateway left out is empty, and absent params are an empty
* object.
*
* @internal
*/
export declare function searchIndexFromProto(index: IndexPb): SearchIndex;
/**
* Search index management over the gateway's `SearchAdminService`.
*
* @internal
*/
export declare class Couchbase2SearchIndexes implements SearchIndexManagementBackend {
private readonly _channel;
private readonly _client;
constructor(channel: Couchbase2Channel, client: SearchAdminServiceClient);
/**
* Reads one index with `SearchAdminService.GetIndex`. A success that
* carries no index describes none, so it raises `IndexNotFoundError`.
*/
getIndex(indexName: string, req: SearchIndexRequest): Promise;
/**
* Lists the indexes with `SearchAdminService.ListIndexes`.
*/
getAllIndexes(req: SearchIndexRequest): Promise;
/**
* Creates an index with `SearchAdminService.CreateIndex`, or updates one
* with `SearchAdminService.UpdateIndex` when the definition has a uuid.
* The server refuses an update whose uuid is no longer the index's.
*/
upsertIndex(index: ISearchIndex, req: SearchIndexRequest): Promise;
/**
* Drops an index with `SearchAdminService.DeleteIndex`.
*/
dropIndex(indexName: string, req: SearchIndexRequest): Promise;
/**
* Counts the index's documents with
* `SearchAdminService.GetIndexedDocumentsCount`.
*/
getIndexedDocumentsCount(indexName: string, req: SearchIndexRequest): Promise;
/**
* Pauses ingest with `SearchAdminService.PauseIndexIngest`.
*/
pauseIngest(indexName: string, req: SearchIndexRequest): Promise;
/**
* Resumes ingest with `SearchAdminService.ResumeIndexIngest`.
*/
resumeIngest(indexName: string, req: SearchIndexRequest): Promise;
/**
* Allows querying with `SearchAdminService.AllowIndexQuerying`.
*/
allowQuerying(indexName: string, req: SearchIndexRequest): Promise;
/**
* Disallows querying with `SearchAdminService.DisallowIndexQuerying`.
*/
disallowQuerying(indexName: string, req: SearchIndexRequest): Promise;
/**
* Freezes the plan with `SearchAdminService.FreezeIndexPlan`.
*/
freezePlan(indexName: string, req: SearchIndexRequest): Promise;
/**
* Unfreezes the plan with `SearchAdminService.UnfreezeIndexPlan`.
*/
unfreezePlan(indexName: string, req: SearchIndexRequest): Promise;
/**
* Analyzes `document` with `SearchAdminService.AnalyzeDocument`,
* returning the analysis as a classic connection does.
*/
analyzeDocument(indexName: string, document: any, req: SearchIndexRequest): Promise;
/**
* Sends a request that names one index and carries nothing else.
*/
private _named;
}