This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch feat/1.3.6/ui
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 7b6ba458dd1e9a1029e5a02b4245ff9189daf246
Author: shuai <[email protected]>
AuthorDate: Tue Jul 9 15:15:39 2024 +0800

    fix: adjust the sort order on the search page
---
 ui/src/pages/Search/components/SearchHead/index.tsx | 2 +-
 ui/src/pages/Search/index.tsx                       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/src/pages/Search/components/SearchHead/index.tsx 
b/ui/src/pages/Search/components/SearchHead/index.tsx
index 667c16ec..a175d381 100644
--- a/ui/src/pages/Search/components/SearchHead/index.tsx
+++ b/ui/src/pages/Search/components/SearchHead/index.tsx
@@ -22,7 +22,7 @@ import { useTranslation } from 'react-i18next';
 
 import { QueryGroup } from '@/components';
 
-const sortBtns = ['active', 'newest', 'relevance', 'score'];
+const sortBtns = ['relevance', 'newest', 'active', 'score'];
 
 interface Props {
   count: number;
diff --git a/ui/src/pages/Search/index.tsx b/ui/src/pages/Search/index.tsx
index a016af70..3eeb0ec9 100644
--- a/ui/src/pages/Search/index.tsx
+++ b/ui/src/pages/Search/index.tsx
@@ -42,7 +42,7 @@ const Index = () => {
   const [searchParams] = useSearchParams();
   const page = searchParams.get('page') || 1;
   const q = searchParams.get('q') || '';
-  const order = searchParams.get('order') || 'active';
+  const order = searchParams.get('order') || 'relevance';
   const [isLoading, setIsLoading] = useState(false);
   const { isSkeletonShow } = useSkeletonControl(isLoading);
   const [data, setData] = useState<SearchRes>({

Reply via email to