Skip to content

Commit

Permalink
add search tips in the search result page (#452)
Browse files Browse the repository at this point in the history
* add search tips in the search result page

Signed-off-by: Ran <[email protected]>

* Update locale/zh/translation.json

---------

Signed-off-by: Ran <[email protected]>
  • Loading branch information
ran-huang authored Nov 29, 2023
1 parent 1d96258 commit a522e96
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion locale/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"title": "Sorry. We couldn't find what you're looking for.",
"content1": "Try changing your keywords and search again.",
"content2": "If you can't find what you're looking for, seek help from our <0>Discord channels</0>."
}
},
"searchTip": "Use double quotes for exact match. For example, \"time_zone\"."
},
"tools": {
"tidbOperator": {
Expand Down
3 changes: 2 additions & 1 deletion locale/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"title": "申し訳ありません。",
"content1": "現時点では日本語の検索は提供されていないため、英語と中国語のドキュメントに行ってもう一度試してください。",
"content2": "お探しのものが見つからない場合は、<0>Discord Channels</0>がお勧めです。"
}
},
"searchTip": "フレーズを正確に検索したい場合に「\"」で囲って利用します。例えば、\"time_zone\""
},
"tools": {
"tidbOperator": {
Expand Down
3 changes: 2 additions & 1 deletion locale/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"title": "很抱歉,我们没有找到您期望的内容。",
"content1": "请尝试使用其他关键词再次搜索。",
"content2": "如果您无法找到需要的内容,请尝试前往 <0>AskTUG (TiDB User Group)</0> 进行提问。"
}
},
"searchTip": "使用半角双引号进行精确搜索。例如,\"time_zone\""
},
"tools": {
"tidbOperator": {
Expand Down
4 changes: 4 additions & 0 deletions src/templates/DocSearchTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Layout from "components/Layout";
import SearchResults from "components/Search/Results";
import SearchInput from "components/Search";
import ScrollToTopBtn from "components/Button/ScrollToTopBtn";
import { Tip } from "components/MDXComponents";
import Seo from "components/Layout/Seo";
import { algoliaClient } from "utils/algolia";
import {
Expand Down Expand Up @@ -307,6 +308,9 @@ export default function DocSearchTemplate() {
</Box>
)}
</Stack>
<Tip>
<Trans i18nKey="search.searchTip" />
</Tip>
<SearchResults loading={isLoading} data={results} />
<Box
sx={{
Expand Down

0 comments on commit a522e96

Please sign in to comment.