Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add stats to search response #1648

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/x-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export * from './previewable.model';
export * from './promoted.model';
export * from './redirection.model';
export * from './sort.model';
export * from './stats.model';
export * from './suggestion.model';
export * from './tagging.model';
export * from './user-info.model';
Expand Down
2 changes: 2 additions & 0 deletions packages/x-types/src/response/search-response.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Promoted } from '../promoted.model';
import { TaggingRequest } from '../request/tagging-request.model';
import { Redirection } from '../redirection.model';
import { Result } from '../result/result.model';
import { Stats } from '../stats.model';

/**
* Response for the search endpoint.
Expand All @@ -21,5 +22,6 @@ export interface SearchResponse {
redirections?: Redirection[];
results: Result[];
spellcheck?: string;
stats?: Stats;
totalResults: number;
}
10 changes: 10 additions & 0 deletions packages/x-types/src/stats.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Statistics for the current search results.
*
* Price - interval of the prices of the results.
*
* @public
*/
export interface Stats {
price: { min: number; max: number };
}
Loading