Skip to content

Commit 0ad2764

Browse files
algolia-bote-krebsshortcuts
committed
feat(specs): improve Composition Client searchResponse specs (matches SearchClient more closely for IS) (generated)
algolia/api-clients-automation#4300 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Emmanuel Krebs <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent aac768e commit 0ad2764

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

packages/client-composition/model/searchHits.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,14 @@ export type SearchHits<T = Record<string, unknown>> = Record<string, any> & {
77
* Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
88
*/
99
hits: Hit<T>[];
10+
11+
/**
12+
* Search query.
13+
*/
14+
query: string;
15+
16+
/**
17+
* URL-encoded string of all search parameters.
18+
*/
19+
params: string;
1020
};

packages/client-composition/model/searchPagination.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ export type SearchPagination = {
44
/**
55
* Page of search results to retrieve.
66
*/
7-
page?: number;
7+
page: number;
88

99
/**
1010
* Number of results (hits).
1111
*/
12-
nbHits?: number;
12+
nbHits: number;
1313

1414
/**
1515
* Number of pages of results.
1616
*/
17-
nbPages?: number;
17+
nbPages: number;
1818

1919
/**
2020
* Number of hits per page.
2121
*/
22-
hitsPerPage?: number;
22+
hitsPerPage: number;
2323
};

packages/client-composition/model/searchResults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export type SearchResults<T = Record<string, unknown>> = {
66
/**
77
* Search results.
88
*/
9-
results?: SearchResultsItem<T>[];
9+
results: SearchResultsItem<T>[];
1010
};

0 commit comments

Comments
 (0)