mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
feat: support nlp date in node reference (#11531)
feat: support nlp date in node reference
This commit is contained in:
@@ -1654,13 +1654,17 @@
|
||||
"Return matched blocks that are not built-in"
|
||||
[q]
|
||||
(p/let [block (state/get-edit-block)
|
||||
pages (search/block-search (state/get-current-repo) q {:built-in? false
|
||||
:enable-snippet? false})]
|
||||
(keep (fn [b]
|
||||
(when-let [id (:block/uuid b)]
|
||||
(when-not (= id (:block/uuid block)) ; avoid block self-reference
|
||||
(db/entity [:block/uuid id]))))
|
||||
pages)))
|
||||
nodes (search/block-search (state/get-current-repo) q {:built-in? false
|
||||
:enable-snippet? false})
|
||||
matched (keep (fn [b]
|
||||
(when-let [id (:block/uuid b)]
|
||||
(when-not (= id (:block/uuid block)) ; avoid block self-reference
|
||||
(db/entity [:block/uuid id]))))
|
||||
nodes)
|
||||
matched-dates (map (fn [title] {:block/title title
|
||||
:nlp-date? true}) date/nlp-pages)]
|
||||
(-> (concat matched-dates matched)
|
||||
(search/fuzzy-search q {:extract-fn :block/title :limit 50}))))
|
||||
|
||||
(defn <get-matched-templates
|
||||
[q]
|
||||
|
||||
Reference in New Issue
Block a user