import { DynamicModule } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { HubResource } from '../../../../hub-resource.enum'; import { SearchDocument } from '../../../../models'; import { AuthenticationModuleOptions } from '../../../authentication'; import { CacheService } from '../../../cache'; import { BaseHttpService } from '../../base-http.service'; import { ServicesModuleOptions } from '../../services-module-options.interface'; import { IndexDocumentDtoV1 } from './dtos'; export declare function InjectFeatureSearchService(): ParameterDecorator; /** * SearchService * * Handles indexing, deindexing, and similarity search for specified resource types. * Acts as a bridge to an internal search microservice (e.g., Meilisearch). */ export declare class SearchService extends BaseHttpService { readonly options: ServicesModuleOptions; private readonly cacheService?; /** * Creates a SearchService client for a specific resource. * * @param authenticationOptions Authentication options injected from the Auth module. * @param options Options specifying the resource type this service operates on. * @param configService NestJS configuration service for environment variables and URLs. * @param cacheService Optional caching service for retrieving similar documents efficiently. */ constructor(authenticationOptions: AuthenticationModuleOptions, options: ServicesModuleOptions, configService: ConfigService, cacheService?: CacheService); /** * Factory method for creating a resource-specific SearchService module. * * @param resource - The resource type this module will provide services for. * @returns A DynamicModule that provides a SearchService instance for the specified resource. */ static forResource(resource: HubResource): DynamicModule; /** * Indexes or updates a searchable document in the search index. * Useful for ensuring resource changes are discoverable via search. * * @param {string} resourceId - Unique identifier of the resource. * @param {IndexDocumentDtoV1} document - Document containing searchable content. */ indexDocumentV1(resourceId: string, document: IndexDocumentDtoV1): void; /** * Removes a resource from the search index. * Ideal when the resource is deleted or should no longer be discoverable. * * @param {string} resourceId - Identifier of the resource to be deindexed. */ deleteDocumentV1(resourceId: string): void; /** * Retrieves documents similar to the provided resource from the search index. * Helps with content discovery and recommendations. * * @param {string} resourceId - Identifier of the base resource for similarity matching. * @returns {Promise} - Array of documents similar to the given resource. */ fetchSimilarDocumentsV1(resourceId: string): Promise; /** * Retrieves similar documents from the cache if available; otherwise fetches from the backend. * * @param resourceId Unique identifier of the resource. * @returns Cached or freshly retrieved similar documents. */ fetchCachedSimilarDocumentsV1(resourceId: string): Promise; }