fix: improve search precision

pull/1436/head
Tienson Qin 2021-03-10 22:05:42 +08:00
parent f430306a85
commit 4f80bb6139
3 changed files with 11 additions and 8 deletions

View File

@ -225,12 +225,6 @@ pre.code {
}
mark {
background: #fef3ac;
color: #262626;
padding: 0 1px;
}
dl {
margin: 1rem 0;
}
@ -735,11 +729,19 @@ a.navigation {
/* text mark/highlight */
mark {
background: #fef3ac;
color: #262626;
padding: 2px 4px;
border-radius: 3px;
font-size: 14px;
}
/* search results */
.search-results mark {
padding: 0;
border-radius: 0;
}
/* page reference */
.page-reference {

View File

@ -152,7 +152,8 @@
:width 500})}
(ui/auto-complete
result
{:on-chosen (fn [{:keys [type data]}]
{:class "search-results"
:on-chosen (fn [{:keys [type data]}]
(search-handler/clear-search!)
(leave-focus)
(case type

View File

@ -39,7 +39,7 @@
(clj->js {:keys ["uuid" "content"]
:shouldSort true
:minMatchCharLength 2
:threshold 0.4}))]
:threshold 0.2}))]
(swap! indices assoc-in [repo :blocks] indice)
indice)))