import * as _wix_sdk_types from '@wix/sdk-types'; import { SearchSpec, Search as Search$1, NonNullablePaths } from '@wix/sdk-types'; interface SiteDocument { /** * Result ID. * @readonly * @maxLength 120 */ _id?: string; /** The document payload. */ data?: Record | null; } interface SearchRequest { /** Search query and aggregation information. */ search: Search; /** Document type to search in. */ documentType: DocumentTypeWithLiterals; /** * Language to search in. * @format LANGUAGE */ language?: string | null; } interface Search extends SearchPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` * @maxSize 10 */ sort?: Sorting[]; /** * A search method for grouping data into various categories (facets) and providing summaries for each category. For example, use aggregations to categorize search results by specific price ranges, brand names, or ratings. * @maxSize 10 */ aggregations?: Aggregation[]; /** Search information. */ search?: SearchDetails; } /** @oneof */ interface SearchPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; } interface Sorting { /** * Name of the field to sort by. * @minLength 2 * @maxLength 100 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface Aggregation extends AggregationKindOneOf { /** Pass if `type` is `VALUE`. A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */ value?: ValueAggregation; /** Pass if `type` is `SCALAR`. A scalar aggregation calculates a single numerical value from a dataset, such as the total, minimum, or maximum value, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in a store. */ scalar?: ScalarAggregation; /** Pass if `type` is `NESTED`. A nested aggregation is applied to the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. This allows for more complex analyses that summarize data at different levels of detail or hierarchy. For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on the field containing the price, and a second value aggregation on the field indicating whether a product is in stock. You can nest up to a maximum of 3 aggregations. Each aggregation can be either value-based or scalar, allowing flexibility in how the data is grouped and analyzed. */ nested?: NestedAggregation; /** * Aggregation name displayed in the return. * @maxLength 100 */ name?: string | null; /** Type of aggregation to perform. */ type?: AggregationTypeWithLiterals; /** * Field to aggregate by. * @maxLength 200 */ fieldPath?: string; } /** @oneof */ interface AggregationKindOneOf { /** Pass if `type` is `VALUE`. A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */ value?: ValueAggregation; /** Pass if `type` is `SCALAR`. A scalar aggregation calculates a single numerical value from a dataset, such as the total, minimum, or maximum value, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in a store. */ scalar?: ScalarAggregation; /** Pass if `type` is `NESTED`. A nested aggregation is applied to the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. This allows for more complex analyses that summarize data at different levels of detail or hierarchy. For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on the field containing the price, and a second value aggregation on the field indicating whether a product is in stock. You can nest up to a maximum of 3 aggregations. Each aggregation can be either value-based or scalar, allowing flexibility in how the data is grouped and analyzed. */ nested?: NestedAggregation; } declare enum ScalarType { /** Unknown scalar type. */ UNKNOWN_SCALAR_TYPE = "UNKNOWN_SCALAR_TYPE", /** Minimum value. */ MIN = "MIN", /** Maximum value. */ MAX = "MAX" } /** @enumType */ type ScalarTypeWithLiterals = ScalarType | 'UNKNOWN_SCALAR_TYPE' | 'MIN' | 'MAX'; declare enum NestedAggregationType { /** Unknown aggregation type. */ UNKNOWN_AGGREGATION_TYPE = "UNKNOWN_AGGREGATION_TYPE", /** An aggregation where result buckets are dynamically built - one per unique value. */ VALUE = "VALUE", /** A single-value metric aggregation - e.g. min, max, sum, avg. */ SCALAR = "SCALAR" } /** @enumType */ type NestedAggregationTypeWithLiterals = NestedAggregationType | 'UNKNOWN_AGGREGATION_TYPE' | 'VALUE' | 'SCALAR'; interface ValueAggregation { /** * Maximum number of aggregation results to return. * Min: `1` * Max: `250` * Default: `10` */ limit?: number | null; } interface ScalarAggregation { /** Type of scalar aggregation. */ type?: ScalarTypeWithLiterals; } interface NestedAggregationItem extends NestedAggregationItemKindOneOf { /** Pass if `type` is `VALUE`. A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */ value?: ValueAggregation; /** Pass if `type` is `SCALAR`. A scalar aggregation calculates a single numerical value from a dataset, such as the total, minimum, or maximum value, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in a store. */ scalar?: ScalarAggregation; /** * Aggregation name displayed in the return. * @maxLength 100 */ name?: string | null; /** Type of aggregation to perform. */ type?: NestedAggregationTypeWithLiterals; /** * Field to aggregate by. * @maxLength 200 */ fieldPath?: string; } /** @oneof */ interface NestedAggregationItemKindOneOf { /** Pass if `type` is `VALUE`. A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */ value?: ValueAggregation; /** Pass if `type` is `SCALAR`. A scalar aggregation calculates a single numerical value from a dataset, such as the total, minimum, or maximum value, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in a store. */ scalar?: ScalarAggregation; } declare enum AggregationType { UNKNOWN_AGGREGATION_TYPE = "UNKNOWN_AGGREGATION_TYPE", /** An aggregation where result buckets are dynamically built - one per unique value. */ VALUE = "VALUE", /** A single-value metric aggregation - e.g. min, max, sum, avg. */ SCALAR = "SCALAR", /** Multi-level aggregation, where each next aggregation is nested within previous one. */ NESTED = "NESTED" } /** @enumType */ type AggregationTypeWithLiterals = AggregationType | 'UNKNOWN_AGGREGATION_TYPE' | 'VALUE' | 'SCALAR' | 'NESTED'; /** List of aggregations. Each aggregation is nested within the previous one. */ interface NestedAggregation { /** * List of aggregations, where each aggregation is nested within previous one. * @minSize 2 * @maxSize 3 */ nestedAggregations?: NestedAggregationItem[]; } interface SearchDetails { /** * Search term or expression. * @maxLength 100 */ expression?: string | null; /** * Fields to search in. * If the array is empty, all fields are searched. * @maxSize 10 * @maxLength 50 */ fields?: string[]; /** Whether to allow the search function to automatically correct typos or minor mistakes in the search expression. The search function uses an algorithm to find results that are close to the text provided. */ fuzzy?: boolean; } interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } declare enum DocumentType { UNSPECIFIED = "UNSPECIFIED", BLOG_POSTS = "BLOG_POSTS", BOOKING_SERVICES = "BOOKING_SERVICES", EVENTS = "EVENTS", FORUM_CONTENT = "FORUM_CONTENT", ONLINE_PROGRAMS = "ONLINE_PROGRAMS", PROGALLERY_ITEM = "PROGALLERY_ITEM", STORES_PRODUCTS = "STORES_PRODUCTS" } /** @enumType */ type DocumentTypeWithLiterals = DocumentType | 'UNSPECIFIED' | 'BLOG_POSTS' | 'BOOKING_SERVICES' | 'EVENTS' | 'FORUM_CONTENT' | 'ONLINE_PROGRAMS' | 'PROGALLERY_ITEM' | 'STORES_PRODUCTS'; interface SearchResponse extends SearchResponsePagingOneOf { /** Paging metadata. */ pagingOffsetMetadata?: PagingMetadata; /** Documents matching the search query. */ siteDocumentItems?: SiteDocument[]; /** Aggregated data. */ aggregationData?: AggregationData; } /** @oneof */ interface SearchResponsePagingOneOf { /** Paging metadata. */ pagingOffsetMetadata?: PagingMetadata; } interface AggregationData { /** * List of the aggregated data results. * @maxSize 10000 */ results?: AggregationResults[]; } interface ValueAggregationResult { /** * Value contained in the field specified in `fieldPath` for this aggregation in the request. * @maxLength 100 */ value?: string; /** Number of documents containing the specified value in the specified field. */ count?: number; } interface ValueResults { /** * List of value aggregation results. * @maxSize 250 */ results?: ValueAggregationResult[]; } interface AggregationResultsScalarResult { /** Type of scalar aggregation. */ type?: ScalarTypeWithLiterals; /** Value of the scalar aggregation. For example, the minimum, maximum, or total value for the specified field. */ value?: number; } interface ValueResult { /** * Value contained in the field specified in `fieldPath` for this aggregation in the request. * @maxLength 1000 */ value?: string; /** Number of documents containing the specified value in the specified field. */ count?: number | null; } interface ScalarResult { /** Scalar aggregation results. */ value?: number; } interface NestedResultValue extends NestedResultValueResultOneOf { /** Value aggregation results. */ value?: ValueResult; /** Scalar aggregation results. */ scalar?: ScalarResult; } /** @oneof */ interface NestedResultValueResultOneOf { /** Value aggregation results. */ value?: ValueResult; /** Scalar aggregation results. */ scalar?: ScalarResult; } interface Results { /** Aggregation results. */ results?: Record; } /** * Results of `NESTED` aggregation type in a flattened form * aggregations in resulting array are keyed by requested aggregation `name`. */ interface NestedResults { /** * List of nested aggregation results. * @maxSize 1000 */ results?: Results[]; } interface AggregationResults extends AggregationResultsResultOneOf { /** Value aggregation results. */ values?: ValueResults; /** Scalar aggregation results. */ scalar?: AggregationResultsScalarResult; /** Nested aggregation results. */ nested?: NestedResults; /** * Aggregation name defined in the request. * @maxLength 100 */ name?: string; /** Type of aggregation that was performed. */ type?: AggregationTypeWithLiterals; /** * Field the data was aggregated by. * @maxLength 200 */ fieldPath?: string; } /** @oneof */ interface AggregationResultsResultOneOf { /** Value aggregation results. */ values?: ValueResults; /** Scalar aggregation results. */ scalar?: AggregationResultsScalarResult; /** Nested aggregation results. */ nested?: NestedResults; } interface PagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. */ total?: number | null; /** Whether the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; } interface AutocompleteRequest { /** * Query phrase to fetch completions for. * @maxLength 50 */ query: string | null; /** Document type to use to search for phrases. */ documentType: DocumentTypeWithLiterals; /** * Limit of phrases to fetch. * @min 1 * @max 100 */ limit?: number; /** * Language to search in. * @format LANGUAGE */ language?: string | null; /** Filter in platformized query language (for example {'field': {'$eq': 'value'}}) */ filter?: Record | null; /** * Autocompletable fields to use for query completion. If not provided, all autocompletable fields in schema are used * @maxSize 10 * @maxLength 50 */ searchFields?: string[]; } interface AutocompleteResponse { /** Suggested phrases. */ values?: AutocompleteResponseValue[]; } interface AutocompleteResponseValue { /** * Suggested phrase. * @maxLength 100 */ query?: string; } interface SuggestRequest { /** Document type of documents to search for. */ documentType: DocumentTypeWithLiterals; /** Suggest query information. */ suggest: Suggest; /** * Number of suggested document to return. * @min 1 * @max 100 */ limit?: number; /** * Language to search in. * @format LANGUAGE */ language?: string | null; } interface Suggest extends SuggestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` * @maxSize 10 */ sort?: Sorting[]; /** Search information. */ suggest?: SuggestDetails; } /** @oneof */ interface SuggestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; } interface SuggestDetails { /** * Search term or expression. * @maxLength 100 */ expression?: string | null; /** * Fields to search in. * If the array is empty, all fields are searched. * @maxSize 10 * @maxLength 50 */ fields?: string[]; } interface SuggestResponse { /** Suggested documents. */ siteDocumentItems?: SiteDocument[]; } interface SearchOptions { /** Document type to search in. */ documentType: DocumentTypeWithLiterals; /** * Language to search in. * @format LANGUAGE */ language?: string | null; } interface SiteDocumentSearchSpec extends SearchSpec { paging: 'offset'; wql: []; } type CommonSearchWithEntityContext = Search$1; type SiteDocumentSearch = { /** Paging options to limit and skip the number of items. */ paging?: { /** Number of items to load. */ limit?: NonNullable['limit'] | null; /** Number of items to skip in the current sort order. */ offset?: NonNullable['offset'] | null; }; /** Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: CommonSearchWithEntityContext['filter'] | null; /** Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` @maxSize: 10 */ sort?: { /** Name of the field to sort by. @minLength: 2, @maxLength: 100 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; /** A search method for grouping data into various categories (facets) and providing summaries for each category. For example, use aggregations to categorize search results by specific price ranges, brand names, or ratings. @maxSize: 10 */ aggregations?: { /** Pass if `type` is `VALUE`. A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number of products (count) for each price listed in the store. */ value?: NonNullable[number]['value']; /** Pass if `type` is `SCALAR`. A scalar aggregation calculates a single numerical value from a dataset, such as the total, minimum, or maximum value, summarizing the dataset into one key metric. For example, use a scalar aggregation to get the minimum price listed in a store. */ scalar?: NonNullable[number]['scalar']; /** Pass if `type` is `NESTED`. A nested aggregation is applied to the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. This allows for more complex analyses that summarize data at different levels of detail or hierarchy. For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on the field containing the price, and a second value aggregation on the field indicating whether a product is in stock. You can nest up to a maximum of 3 aggregations. Each aggregation can be either value-based or scalar, allowing flexibility in how the data is grouped and analyzed. */ nested?: NonNullable[number]['nested']; /** Aggregation name displayed in the return. @maxLength: 100 */ name?: NonNullable[number]['name'] | null; /** Type of aggregation to perform. */ type?: NonNullable[number]['type']; /** Field to aggregate by. @maxLength: 200 */ fieldPath?: NonNullable[number]['fieldPath']; }[]; /** Search information. */ search?: { /** Search term or expression. @maxLength: 100 */ expression?: NonNullable['expression'] | null; /** Fields to search in. If the array is empty, all fields are searched. @maxSize: 10, @maxLength: 50 */ fields?: NonNullable['fields']; /** Whether to allow the search function to automatically correct typos or minor mistakes in the search expression. The search function uses an algorithm to find results that are close to the text provided. */ fuzzy?: NonNullable['fuzzy']; }; }; declare const utils: { search: { SearchBuilder: () => _wix_sdk_types.SearchBuilder; Filter: _wix_sdk_types.FilterFactory; Sort: _wix_sdk_types.SortFactory; SearchParams: _wix_sdk_types.SearchParamsFactory; Aggregation: _wix_sdk_types.AggregationFactory; }; }; /** * Provides phrase completion. For example "blu" could return "blue", "blues" and "blunt" as candidate phrases. * This operation is resource heavy at index time and is reserved for special use cases. * @param query - Query phrase to fetch completions for. * @param documentType - Document type to use to search for phrases. * @internal * @documentationMaturity preview * @requiredField documentType * @requiredField query * @permissionId SEARCH.SITE_DOCUMENT_READ * @applicableIdentity APP * @fqn wix.search.platformized.v1.SiteSearchPlatformizedService.Autocomplete */ declare function autocomplete(query: string, documentType: DocumentTypeWithLiterals, options?: AutocompleteOptions): Promise>; interface AutocompleteOptions { /** * Limit of phrases to fetch. * @min 1 * @max 100 */ limit?: number; /** * Language to search in. * @format LANGUAGE */ language?: string | null; /** Filter in platformized query language (for example {'field': {'$eq': 'value'}}) */ filter?: Record | null; /** * Autocompletable fields to use for query completion. If not provided, all autocompletable fields in schema are used * @maxSize 10 * @maxLength 50 */ searchFields?: string[]; } /** * Executes search query to fetch suggested items. Unlike search query, suggest will match * partial phrases (for example "blu" will match documents containing "blue", "blues" and "blunt"). * Phrase needs to be at least 3 symbols long. Suggestions can also perform optimizations in search * results and generally do not guarantee the same level of quality as regular Search endpoint. * @param documentType - Document type of documents to search for. * @internal * @documentationMaturity preview * @requiredField documentType * @requiredField options.suggest * @permissionId SEARCH.SITE_DOCUMENT_READ * @applicableIdentity APP * @fqn wix.search.platformized.v1.SiteSearchPlatformizedService.Suggest */ declare function suggest(documentType: DocumentTypeWithLiterals, options?: NonNullablePaths): Promise>; interface SuggestOptions { /** Suggest query information. */ suggest: Suggest; /** * Number of suggested document to return. * @min 1 * @max 100 */ limit?: number; /** * Language to search in. * @format LANGUAGE */ language?: string | null; } export { type CommonSearchWithEntityContext as $, type AutocompleteOptions as A, type ValueResult as B, type ScalarResult as C, type DocumentTypeWithLiterals as D, type NestedResultValue as E, type NestedResultValueResultOneOf as F, type NestedResults as G, type AggregationResults as H, type AggregationResultsResultOneOf as I, type PagingMetadata as J, type AutocompleteRequest as K, type AutocompleteResponseValue as L, type SuggestRequest as M, NestedAggregationType as N, type Suggest as O, type Paging as P, type SuggestPagingMethodOneOf as Q, type Results as R, type SiteDocumentSearch as S, type SuggestDetails as T, type SiteDocumentSearchSpec as U, type ValueAggregation as V, utils as W, type SortOrderWithLiterals as X, type ScalarTypeWithLiterals as Y, type NestedAggregationTypeWithLiterals as Z, type AggregationTypeWithLiterals as _, type SearchOptions as a, autocomplete as a0, suggest as a1, type SearchResponse as b, type AutocompleteResponse as c, type SuggestOptions as d, type SuggestResponse as e, SortOrder as f, ScalarType as g, AggregationType as h, DocumentType as i, type SiteDocument as j, type SearchRequest as k, type Search as l, type SearchPagingMethodOneOf as m, type Sorting as n, type Aggregation as o, type AggregationKindOneOf as p, type ScalarAggregation as q, type NestedAggregationItem as r, type NestedAggregationItemKindOneOf as s, type NestedAggregation as t, type SearchDetails as u, type SearchResponsePagingOneOf as v, type AggregationData as w, type ValueAggregationResult as x, type ValueResults as y, type AggregationResultsScalarResult as z };