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.

feat(search): add order: 'relevance' for search

haitao(lj)0ca441336693
diff --git a/ui/src/pages/Search/components/SearchHead/index.tsx b/ui/src/pages/Search/components/SearchHead/index.tsx
index 4cd420bb..2f546322 100644
--- a/ui/src/pages/Search/components/SearchHead/index.tsx
+++ b/ui/src/pages/Search/components/SearchHead/index.tsx
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { QueryGroup } from '@answer/components';
-const sortBtns = ['newest', 'active', '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 7f8c43ed..93019294 100644
--- a/ui/src/pages/Search/index.tsx
+++ b/ui/src/pages/Search/index.tsx
@@ -13,7 +13,7 @@ const Index = () => {
const [searchParams] = useSearchParams();
const page = searchParams.get('page') || 1;
const q = searchParams.get('q') || '';
- const order = searchParams.get('order') || 'newest';
+ const order = searchParams.get('order') || 'relevance';
const { data, isLoading } = useSearch({
q,