import { HttpTypes } from "@medusajs/types"; import { Client } from "../client.js"; import { ClientHeaders } from "../types.js"; /** * This class is used to send requests to Admin Search API routes. * * @since 2.19.0 */ export declare class Search { /** * @ignore */ private client; /** * @ignore */ constructor(client: Client); /** * This method searches across entities. Per entity, results come from the * Search Module when that entity is indexed; otherwise each entity is queried * with the same free-text `q` filter the list endpoints support. * * Results are grouped per entity and paginated independently. * * @param {HttpTypes.AdminSearchParams} query - Search query and pagination parameters. * @param {ClientHeaders} headers - Headers to pass in the request. * @returns {Promise} The grouped search results. * * @example * sdk.admin.search.list({ q: "shirt", limit: 5 }) * .then(({ results }) => { * console.log(results) * }) * * @tags search * @since 2.19.0 */ list(query?: HttpTypes.AdminSearchParams, headers?: ClientHeaders): Promise>>; /** * This method retrieves the registered search indexes, their status, and the * fields each stores. `enabled` is `false` when the Search Module is not * configured. * * @param {ClientHeaders} headers - Headers to pass in the request. * @returns {Promise} The registered search indexes. * * @example * sdk.admin.search.listIndexes() * .then(({ search_indexes, enabled }) => { * console.log(search_indexes, enabled) * }) * * @tags search */ listIndexes(headers?: ClientHeaders): Promise; /** * This method triggers rebuilding a search index from its seed. The rebuild runs in * the background - check the index's `status` through {@link listIndexes} to know * when it's done. * * @param {string} id - The name of the index to reindex. * @param {ClientHeaders} headers - Headers to pass in the request. * @returns {Promise} The triggered reindex job. * * @example * sdk.admin.search.reindex("product") * .then(({ job_id, indexes }) => { * console.log(job_id, indexes) * }) * * @tags search */ reindex(id: string, headers?: ClientHeaders): Promise; } //# sourceMappingURL=search.d.ts.map