Search across all content types via khoj.el on Emacs

If no content-type selected in transient menu option, khoj.el queries
khoj server without content-type parameter (t) set.

This results in search across all enabled asymmetric search text
content types
This commit is contained in:
Debanjum Singh Solanky 2023-06-20 23:39:19 -07:00
parent 2cd3e799d3
commit 5c4eb950d5

View file

@ -651,7 +651,9 @@ CONFIG is json obtained from Khoj config API."
Use QUERY, CONTENT-TYPE and (optional) RERANK as query params"
(let ((rerank (or rerank "false"))
(encoded-query (url-hexify-string query)))
(format "%s/api/search?q=%s&t=%s&r=%s&n=%s&client=emacs" khoj-server-url encoded-query content-type rerank khoj-results-count)))
(if content-type
(format "%s/api/search?q=%s&r=%s&n=%s&client=emacs" khoj-server-url encoded-query rerank khoj-results-count)
(format "%s/api/search?q=%s&t=%s&r=%s&n=%s&client=emacs&t=%s" khoj-server-url content-type encoded-query rerank khoj-results-count))))
(defun khoj--query-search-api-and-render-results (query-url content-type query buffer-name)
"Query Khoj Search with QUERY-URL.