fix: search-block-aux typo

pull/7540/head
Junyi Du 2022-11-30 13:29:27 +08:00 committed by Tienson Qin
parent e19fc7da04
commit 4c6bf7aced
1 changed files with 10 additions and 3 deletions

View File

@ -273,17 +273,23 @@
(->>
(concat matched-result
(search-blocks-aux database non-match-sql non-match-input page limit))
(distinct-by :id)
(distinct-by :rowid)
(take limit)
(vec))))))
(defn- snippet-by
[content length]
(str (subs content 0 length) "..."))
(defn- search-pages-res-unpack
[arr]
(let [[rowid uuid content snippet] arr]
{:id rowid
:uuid uuid
:content content
:snippet snippet}))
:snippet (if (string/includes? snippet "$pfts_2lqh>$ ")
snippet
(snippet-by snippet 250))}))
(defn- search-pages-aux
[database sql input limit]
@ -317,7 +323,8 @@
match-inputs)
(apply concat))]
(->>
matched-result
(concat matched-result
(search-pages-aux database non-match-sql non-match-input limit))
(distinct-by :id)
(take limit)
(vec))))))