From a522e966ed05567cad9fa32e9ab6e9fb871a4573 Mon Sep 17 00:00:00 2001 From: Ran Date: Wed, 29 Nov 2023 15:00:42 +0800 Subject: [PATCH] add search tips in the search result page (#452) * add search tips in the search result page Signed-off-by: Ran * Update locale/zh/translation.json --------- Signed-off-by: Ran --- locale/en/translation.json | 3 ++- locale/ja/translation.json | 3 ++- locale/zh/translation.json | 3 ++- src/templates/DocSearchTemplate.tsx | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/locale/en/translation.json b/locale/en/translation.json index fb3fc08af..0abf65d5a 100644 --- a/locale/en/translation.json +++ b/locale/en/translation.json @@ -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." - } + }, + "searchTip": "Use double quotes for exact match. For example, \"time_zone\"." }, "tools": { "tidbOperator": { diff --git a/locale/ja/translation.json b/locale/ja/translation.json index b83dbd6cb..dd06b7655 100644 --- a/locale/ja/translation.json +++ b/locale/ja/translation.json @@ -83,7 +83,8 @@ "title": "申し訳ありません。", "content1": "現時点では日本語の検索は提供されていないため、英語と中国語のドキュメントに行ってもう一度試してください。", "content2": "お探しのものが見つからない場合は、<0>Discord Channelsがお勧めです。" - } + }, + "searchTip": "フレーズを正確に検索したい場合に「\"」で囲って利用します。例えば、\"time_zone\"。" }, "tools": { "tidbOperator": { diff --git a/locale/zh/translation.json b/locale/zh/translation.json index 02b735352..9ace130d7 100644 --- a/locale/zh/translation.json +++ b/locale/zh/translation.json @@ -80,7 +80,8 @@ "title": "很抱歉,我们没有找到您期望的内容。", "content1": "请尝试使用其他关键词再次搜索。", "content2": "如果您无法找到需要的内容,请尝试前往 <0>AskTUG (TiDB User Group) 进行提问。" - } + }, + "searchTip": "使用半角双引号进行精确搜索。例如,\"time_zone\"。" }, "tools": { "tidbOperator": { diff --git a/src/templates/DocSearchTemplate.tsx b/src/templates/DocSearchTemplate.tsx index d51f2a7a9..7f2b036ec 100644 --- a/src/templates/DocSearchTemplate.tsx +++ b/src/templates/DocSearchTemplate.tsx @@ -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 { @@ -307,6 +308,9 @@ export default function DocSearchTemplate() { )} + + +