From a799972bb12808cb6c8cc68fda4d69fd9ec4d461 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Mon, 3 Oct 2022 10:09:32 +0200 Subject: [PATCH] Update api reports and add changeset files Signed-off-by: Camila Belo --- .changeset/search-cars-hide.md | 5 +++++ .changeset/search-cycles-sniff.md | 5 +++++ .changeset/search-days-pull.md | 5 +++++ .changeset/search-otters-destroy.md | 5 +++++ .changeset/search-rats-grin.md | 14 ++++++++++++++ plugins/search-common/api-report.md | 2 ++ plugins/search-react/api-report.md | 2 ++ 7 files changed, 38 insertions(+) create mode 100644 .changeset/search-cars-hide.md create mode 100644 .changeset/search-cycles-sniff.md create mode 100644 .changeset/search-days-pull.md create mode 100644 .changeset/search-otters-destroy.md create mode 100644 .changeset/search-rats-grin.md diff --git a/.changeset/search-cars-hide.md b/.changeset/search-cars-hide.md new file mode 100644 index 0000000000..b89662e90a --- /dev/null +++ b/.changeset/search-cars-hide.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-common': minor +--- + +There is a new property called `pageLimit` on the `SearchQuery` interface that specifies how many results should be returned per page. diff --git a/.changeset/search-cycles-sniff.md b/.changeset/search-cycles-sniff.md new file mode 100644 index 0000000000..e422d50806 --- /dev/null +++ b/.changeset/search-cycles-sniff.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-backend-module-elasticsearch': minor +--- + +The `Elastic Search` search engine query now contains a property called `pageLimit`, this new property specifies how many results to return per page and its default value is 25. diff --git a/.changeset/search-days-pull.md b/.changeset/search-days-pull.md new file mode 100644 index 0000000000..3a3c09d5bb --- /dev/null +++ b/.changeset/search-days-pull.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-react': minor +--- + +Added new page boundary to search query context and results state. diff --git a/.changeset/search-otters-destroy.md b/.changeset/search-otters-destroy.md new file mode 100644 index 0000000000..b91b98c173 --- /dev/null +++ b/.changeset/search-otters-destroy.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-backend-node': minor +--- + +The `Lunr` search engine query now contains a property called `pageLimit`, this new property specifies how many results to return per page and its default value is 25. diff --git a/.changeset/search-rats-grin.md b/.changeset/search-rats-grin.md new file mode 100644 index 0000000000..16d4e293c0 --- /dev/null +++ b/.changeset/search-rats-grin.md @@ -0,0 +1,14 @@ +--- +'@backstage/plugin-search-backend': minor +--- + +The query received by search engines now contains a property called `pageLimit`, it specifies how many results to return per page when sending a query request to the search backend. + +Example: +_Returns up to 30 results per page_ + +``` +GET /query?pageLimit=30 +``` + +It is worth mentioning that only the Lunr and Elastic Search engines currently use this new property in their implementations. So that means you can't use it with Postgres for now. The search backend doesn't set a default value for the page limit parameter, it leaves it up to each search engine to set this, so Lunr and Elastic Search set 25 results per page as a default value. diff --git a/plugins/search-common/api-report.md b/plugins/search-common/api-report.md index ea9fc2d26e..61e5d22257 100644 --- a/plugins/search-common/api-report.md +++ b/plugins/search-common/api-report.md @@ -102,6 +102,8 @@ export interface SearchQuery { // (undocumented) pageCursor?: string; // (undocumented) + pageLimit?: number; + // (undocumented) term: string; // (undocumented) types?: string[]; diff --git a/plugins/search-react/api-report.md b/plugins/search-react/api-report.md index 1160675c5a..ddfe5d5b39 100644 --- a/plugins/search-react/api-report.md +++ b/plugins/search-react/api-report.md @@ -165,6 +165,7 @@ export type SearchContextState = { term: string; types: string[]; filters: JsonObject; + pageLimit?: number; pageCursor?: string; }; @@ -174,6 +175,7 @@ export type SearchContextValue = { setTerm: React_2.Dispatch>; setTypes: React_2.Dispatch>; setFilters: React_2.Dispatch>; + setPageLimit: React_2.Dispatch>; setPageCursor: React_2.Dispatch>; fetchNextPage?: React_2.DispatchWithoutAction; fetchPreviousPage?: React_2.DispatchWithoutAction;