mirror of https://github.com/logseq/logseq
fix: search-block-aux typo
parent
e19fc7da04
commit
4c6bf7aced
|
@ -273,17 +273,23 @@
|
||||||
(->>
|
(->>
|
||||||
(concat matched-result
|
(concat matched-result
|
||||||
(search-blocks-aux database non-match-sql non-match-input page limit))
|
(search-blocks-aux database non-match-sql non-match-input page limit))
|
||||||
(distinct-by :id)
|
(distinct-by :rowid)
|
||||||
(take limit)
|
(take limit)
|
||||||
(vec))))))
|
(vec))))))
|
||||||
|
|
||||||
|
(defn- snippet-by
|
||||||
|
[content length]
|
||||||
|
(str (subs content 0 length) "..."))
|
||||||
|
|
||||||
(defn- search-pages-res-unpack
|
(defn- search-pages-res-unpack
|
||||||
[arr]
|
[arr]
|
||||||
(let [[rowid uuid content snippet] arr]
|
(let [[rowid uuid content snippet] arr]
|
||||||
{:id rowid
|
{:id rowid
|
||||||
:uuid uuid
|
:uuid uuid
|
||||||
:content content
|
:content content
|
||||||
:snippet snippet}))
|
:snippet (if (string/includes? snippet "$pfts_2lqh>$ ")
|
||||||
|
snippet
|
||||||
|
(snippet-by snippet 250))}))
|
||||||
|
|
||||||
(defn- search-pages-aux
|
(defn- search-pages-aux
|
||||||
[database sql input limit]
|
[database sql input limit]
|
||||||
|
@ -317,7 +323,8 @@
|
||||||
match-inputs)
|
match-inputs)
|
||||||
(apply concat))]
|
(apply concat))]
|
||||||
(->>
|
(->>
|
||||||
matched-result
|
(concat matched-result
|
||||||
|
(search-pages-aux database non-match-sql non-match-input limit))
|
||||||
(distinct-by :id)
|
(distinct-by :id)
|
||||||
(take limit)
|
(take limit)
|
||||||
(vec))))))
|
(vec))))))
|
||||||
|
|
Loading…
Reference in New Issue