Skip to content

Commit

Permalink
feat(specs): improve Composition Client searchResponse specs (matches…
Browse files Browse the repository at this point in the history
… 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]>
  • Loading branch information
3 people committed Jan 6, 2025
1 parent aac768e commit 0ad2764
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions packages/client-composition/model/searchHits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ export type SearchHits<T = Record<string, unknown>> = Record<string, any> & {
* Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
*/
hits: Hit<T>[];

/**
* Search query.
*/
query: string;

/**
* URL-encoded string of all search parameters.
*/
params: string;
};
8 changes: 4 additions & 4 deletions packages/client-composition/model/searchPagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ export type SearchPagination = {
/**
* Page of search results to retrieve.
*/
page?: number;
page: number;

/**
* Number of results (hits).
*/
nbHits?: number;
nbHits: number;

/**
* Number of pages of results.
*/
nbPages?: number;
nbPages: number;

/**
* Number of hits per page.
*/
hitsPerPage?: number;
hitsPerPage: number;
};
2 changes: 1 addition & 1 deletion packages/client-composition/model/searchResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export type SearchResults<T = Record<string, unknown>> = {
/**
* Search results.
*/
results?: SearchResultsItem<T>[];
results: SearchResultsItem<T>[];
};

0 comments on commit 0ad2764

Please sign in to comment.