((p "Zettelstore starts its web service before the initial indexing of all zettel is complete." " " "Until then, search results and some calculated metadata may be incomplete." " " "Zettel metadata evaluated in this phase contains the key " (a ((href . "00001006020000#index-state")) (kbd "index-state")) " with the value " (kbd "incomplete") ".") (p "To find out whether the box service is completely ready, send an HTTP GET request to the endpoint " (kbd "/x") " with the query parameter " (kbd "data=ready") ".") (p "This request does not require authentication, even if " (a ((href . "00001010040100")) "authentication is enabled") "." " " "It does not provide any information about the content of the Zettelstore.") (pre (code ((class . "language-sh")) "# curl -i 'http://127.0.0.1:23123/x?data=ready'\nHTTP/1.1 503 Service Unavailable\nCache-Control: no-store\nRetry-After: 1\nContent-Type: text/plain; charset=utf-8\n\nincomplete")) (pre (code ((class . "language-sh")) "# curl -i 'http://127.0.0.1:23123/x?data=ready'\nHTTP/1.1 200 OK\nCache-Control: no-store\nContent-Type: text/plain; charset=utf-8\n\nready")) (p "The body contains a plain text value for human readers, followed by a newline:") (dl (dt (kbd "ready")) (dd (p "The box service is started, and the initial indexing is complete.")) (dt (kbd "incomplete")) (dd (p "The box service is started, but the initial indexing is not complete yet."))) (p "The HTTP status code is authoritative." " " "Clients must treat the status codes " (kbd "200") " and " (kbd "204") " as " (@L (@H "“") "ready" (@H "”")) "." " " "Currently, only " (kbd "200") " is used, with the body " (kbd "ready") "." " " "Future versions may respond with " (kbd "204") " and an empty body." " " "Status " (kbd "503") " means " (@L (@H "“") "incomplete" (@H "”")) "." " " "The body is informational only and should not be evaluated by clients." " " "Intermediate components, such as reverse proxies, may replace the body of a " (kbd "503") " response.") (p "Once " (kbd "ready") " is reported, the state does not change back during the lifetime of the Zettelstore process, even if the index is rebuilt later." " " "During a rebuild, the previous index continues to serve requests.") (p "Clients should poll this endpoint until it reports " (kbd "ready") "." " " "The value of the " (kbd "Retry-After") " header is a hint for the polling interval in seconds.") (h3 ((id . "http-status-codes")) "HTTP Status codes") (dl (dt (kbd "200") ", " (kbd "204")) (dd (p "The box service is ready." " " "Currently, only " (kbd "200") " is used.")) (dt (kbd "400")) (dd (p "The value of the query parameter " (kbd "data") " is unknown.")) (dt (kbd "503")) (dd (p "The box service is running, but the initial indexing is not complete." " " "Try again after the number of seconds given in the " (kbd "Retry-After") " header."))))