Change order of arg passed to query-api-and-render-results by importance

This commit is contained in:
Debanjum Singh Solanky 2023-01-20 22:11:00 -03:00
parent 936a88fa7e
commit b7aa22a059

View file

@ -275,9 +275,8 @@ Use `which-key` if available, else display simple message in echo area"
(encoded-query (url-hexify-string query)))
(format "%s/api/search?q=%s&t=%s&r=%s&n=%s" khoj-server-url encoded-query content-type rerank khoj-results-count)))
(defun khoj--query-api-and-render-results (query content-type query-url buffer-name)
"Query Khoj API using QUERY, CONTENT-TYPE, QUERY-URL.
Render results in BUFFER-NAME."
(defun khoj--query-api-and-render-results (query-url content-type query buffer-name)
"Query Khoj QUERY-URL. Render results in BUFFER-NAME using QUERY, CONTENT-TYPE."
;; get json response from api
(with-current-buffer buffer-name
(let ((inhibit-read-only t)
@ -335,9 +334,9 @@ Render results in BUFFER-NAME."
(setq khoj--rerank t)
(message "Khoj: Rerank Results"))
(khoj--query-api-and-render-results
query
khoj--content-type
query-url
khoj--content-type
query
khoj-buffer-name))))))
(defun khoj--delete-open-network-connections-to-server ()
@ -438,9 +437,9 @@ Render results in BUFFER-NAME."
(buffer-name (get-buffer-create khoj--buffer-name)))
(progn
(khoj--query-api-and-render-results
query-title
content-type
query-url
content-type
query-title
buffer-name)
(switch-to-buffer buffer-name)
(goto-char (point-min)))))