Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: adjust the sort order on the search page

shuai7b6ba458dd1e
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>({