{"id":34653884,"url":"https://github.com/runeanielsen/typesense-clj","last_synced_at":"2025-12-24T18:00:13.502Z","repository":{"id":37990638,"uuid":"408251336","full_name":"runeanielsen/typesense-clj","owner":"runeanielsen","description":"Clojure HTTP client for Typesense","archived":false,"fork":false,"pushed_at":"2025-03-23T07:44:41.000Z","size":184,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-24T03:06:56.572Z","etag":null,"topics":["clojure","typesense"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/runeanielsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-19T22:31:53.000Z","updated_at":"2025-11-14T21:45:20.000Z","dependencies_parsed_at":"2023-01-20T23:45:09.358Z","dependency_job_id":"c91c4830-fa5a-4b6f-931b-ce4c0908c9ec","html_url":"https://github.com/runeanielsen/typesense-clj","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/runeanielsen/typesense-clj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runeanielsen%2Ftypesense-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runeanielsen%2Ftypesense-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runeanielsen%2Ftypesense-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runeanielsen%2Ftypesense-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runeanielsen","download_url":"https://codeload.github.com/runeanielsen/typesense-clj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runeanielsen%2Ftypesense-clj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","typesense"],"created_at":"2025-12-24T18:00:12.203Z","updated_at":"2025-12-24T18:00:13.444Z","avatar_url":"https://github.com/runeanielsen.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clojure client for Typesense\n\n[![Clojars Project](https://img.shields.io/clojars/v/io.github.runeanielsen/typesense-clj.svg)](https://clojars.org/io.github.runeanielsen/typesense-clj)\n\nClojure client for [Typesense 28.0](https://github.com/typesense/typesense)\n\nAll of the examples uses the `typesense.client` namespace. The examples shows the simplest way to get started using the client, but all parameters described on Typesense API documentation should work, if that is not the case, please make a pull-request or open an issue.\n\nThe values shown in the example might not be 100% up to date with the current Typesense version, please go to the Typesense documentation to be sure of the return values.\n\n## Settings\n\nTwo values are currently required for settings.\n\n* `Uri` the base-uri for Typesense, an example is \"https://localhost:8108\".\n* `Key` the api-key required for the header `X-TYPESENSE-API-KEY`.\n\nExample of settings.\n\n```clojure\n(def settings {:uri \"http://localhost:8108\"\n               :key \"my-super-secret-api-key\"})\n```\n\n## Collection\n\nThis section describes how to use the collection, further information can be found [here.](https://typesense.org/docs/28.0/api/collections.html#create-a-collection)\n\n### Create collection\n\nThe different `types` for the schema can be found [here](https://typesense.org/docs/28.0/api/collections.html#create-a-collection).\n\nThe examples displays the creation of collection named `companies`.\n\n```clojure\n(create-collection!\n settings\n {:name \"companies\"\n  :fields [{:name \"company_name\"\n            :type \"string\"}\n           {:name \"num_employees\"\n            :type \"int32\"}\n           {:name \"country\"\n            :type \"string\"\n            :facet true}]\n  :default_sorting_field \"num_employees\"})\n\n;; Example success response =\u003e\n{:default_sorting_field \"num_employees\"\n :enable_nested_fields false\n :fields [{:facet false\n           :index true\n           :name \"company_name\"\n           :optional false\n           :stem false\n           :type \"string\"\n           :infix false\n           :locale \"\"\n           :sort false}\n          {:facet false\n           :index true\n           :name \"num_employees\"\n           :optional false\n           :stem false\n           :type \"int32\"\n           :infix false\n           :locale \"\"\n           :sort true}\n          {:facet true\n           :index true\n           :name \"country\"\n           :optional false\n           :stem false\n           :type \"string\"\n           :infix false\n           :locale \"\"\n           :sort false}]\n :name \"companies_collection_test\"\n :num_documents 0\n :symbols_to_index []\n :token_separators []}\n```\n\n### Update collection\n\nThe different `types` for the schema can be found [here](https://typesense.org/docs/28.0/api/collections.html#update-or-alter-a-collection).\n\nThe examples shows updating the collection named named `companies` with a new field `year_founded`.\n\n```clojure\n(update-collection!\n settings\n \"companies\"\n {:fields [{:name \"year_founded\"\n            :type \"int32\"\n            :optional true}]})\n\n;; Example success response =\u003e\n{:fields [{:facet false,\n             :index true,\n             :infix false,\n             :locale \"\",\n             :name \"year_founded\",\n             :nested false,\n             :nested_array 0,\n             :num_dim 0,\n             :optional true,\n             :sort true,\n             :stem false\n             :type \"int32\",\n             :vec_dist \"cosine\",\n             +:embed nil,\n             +:reference \"\"}]}\n```\n\n### Delete collection\n\nPermanently drops a collection on the `collection-name`. This action cannot be undone.\nFor large collections, this might have an impact on read latencies.\n\n```clojure\n(delete-collection! settings \"companies\")\n\n;; Example success response =\u003e\n{:created_at 1647261230\n :enable_nested_fields false\n :default_sorting_field \"num_employees\"\n :fields\n [{:facet false\n   :index true\n   :name \"company_name\"\n   :optional false\n   :stem false\n   :type \"string\"}\n  {:facet false\n   :index true\n   :name \"num_employees\"\n   :optional false\n   :stem false\n   :type \"int32\"}\n  {:facet true\n   :index true\n   :name \"country\"\n   :stem false\n   :optional false\n   :type \"string\"}]\n :name \"companies\"\n :num_documents 0\n :symbols_to_index []\n :token_separators []}\n```\n\n### List collections\n\nReturns a summary of all your collections. The collections are returned sorted by creation date, with the most recent collections appearing first.\n\n```clojure\n(list-collections settings)\n\n;; Example success response =\u003e\n[{:default_sorting_field \"num_employees\"\n  :enable_nested_fields false\n  :fields [{:facet false\n            :index true\n            :name \"company_name\"\n            :optional false\n            :type \"string\"\n            :infix false\n            :locale \"\"\n            :sort false}\n           {:facet false\n            :index true\n            :name \"num_employees\"\n            :optional false\n            :type \"int32\"\n            :infix false\n            :locale \"\"\n            :sort true}\n           {:facet true\n            :index true\n            :name \"country\"\n            :optional false\n            :type \"string\"\n            :infix false\n            :locale \"\"\n            :sort false}]\n  :name \"companies_collection_test\"\n  :num_documents 0\n  :symbols_to_index []\n  :token_separators []}]\n```\n\n### Retrieve collection\n\nRetrieves the collection on the `collection-name`.\n\n```clojure\n(retrieve-collection settings \"companies\")\n\n;; Example success response =\u003e\n{:default_sorting_field \"num_employees\"\n :enable_nested_fields false\n :fields [{:facet false\n           :index true\n           :infix false\n           :locale \"\"\n           :name \"company_name\"\n           :optional false\n           :sort false\n           :type \"string\"}\n          {:facet false\n           :index true\n           :infix false\n           :locale \"\"\n           :name \"num_employees\"\n           :optional false\n           :sort true\n           :type \"int32\"}\n          {:facet true\n           :index true\n           :infix false\n           :locale \"\"\n           :name \"country\"\n           :optional false\n           :sort false\n           :type \"string\"}]\n :name \"companies_collection_test\"\n :num_documents 0\n :symbols_to_index []\n :token_separators []}\n```\n\n## Documents\n\nThis section describes how to use the documents, further information can be found [here.](https://typesense.org/docs/28.0/api/documents.html)\n\n### Create document\n\nCreates the document in a given collection. The document should comply with the `schema` of the collection.\n\n```clojure\n(create-document! settings \"companies\" {:company_name \"Stark Industries\"\n                                        :num_employees 5215\n                                        :country \"USA\"})\n\n;; Example success response =\u003e\n{:company_name \"Stark Industries\"\n :country \"USA\"\n :id \"0\"\n :num_employees 5215}\n ```\n\n### Upsert document\n\nUpsert the document in a given collection. The document will either be created or updated depending on if it already exists.\n\n```clojure\n(upsert-document! settings \"companies\" {:company_name \"Awesome Inc.\"\n                                        :num_employees 10\n                                        :country \"Norway\"})\n\n;; Example success response =\u003e\n{:company_name \"Awesome Inc.\"\n :num_employees 10\n :country \"Norway\"\n :id \"1\"}\n```\n\n### Retrieve document\n\nRetrieves document in a collection on `id`. The `id` can be parsed in as `int` or `string`.\n\n```clojure\n(retrieve-document settings \"companies\" 1)\n\n;; Example success response =\u003e\n{:company_name \"Awesome Inc.\"\n :num_employees 10\n :country \"Norway\"\n :id \"1\"}\n```\n\n### Delete document\n\nDeletes document in a collection on `id`. The `id` can be parsed in as `int` or `string`.\n\n```clojure\n(delete-document! settings \"companies\" 1)\n\n;; Example success response =\u003e\n{:company_name \"Stark Industries\"\n :country \"USA\"\n :id \"0\"\n :num_employees 5215}\n```\n\n### Update document\n\nUpdate document in a collection on id. The update can be partial.\n\n```clojure\n(update-document! settings \"companies\" {:company_name \"Mega Awesome Inc.\"} 1)\n\n;; Example success response =\u003e\n{:company_name \"Mega Awesome Inc.\"\n :num_employees 10\n :country \"Norway\"\n :id \"1\"}\n```\n\n## Create/Upsert/Update/Delete Documents\n\nCreate/upsert/update documents. All of them takes optional parameters, an example is setting the batch size using `:batch_size 20`. Read more [here.](https://typesense.org/docs/28.0/api/documents.html#import-documents)\n\n### Create documents\n\n```clojure\n(create-documents! settings\n                   \"companies\"\n                   [{:company_name \"Innovationsoft A/S\"\n                     :num_employees 10\n                     :country \"Finland\"}\n                    {:company_name \"GoSoftware\"\n                     :num_employees 5000\n                     :country \"Sweden\"}])\n\n;; Example success response =\u003e\n[{:success true} {:success true}]\n```\n\n### Upsert documents\n\n```clojure\n(upsert-documents! settings\n                   \"companies\"\n                   [{:company_name \"Innovationsoft A/S\"\n                     :num_employees 10\n                     :country \"Finland\"}\n                    {:company_name \"GoSoftware\"\n                     :num_employees 5000\n                     :country \"Sweden\"}])\n\n;; Example success response =\u003e\n[{:success true} {:success true}]\n```\n\n### Update documents\n\n```clojure\n(update-documents! settings\n                   \"companies\"\n                   [{:id \"1\"\n                     :company_name \"Innovationsoft A/S\"\n                     :num_employees 10\n                     :country \"Finland\"}\n                    {:id \"2\"\n                     :company_name \"GoSoftware\"\n                     :num_employees 5000\n                     :country \"Sweden\"}])\n\n;; Example success response =\u003e\n[{:success true} {:success true}]\n```\n\n### Delete documents\n\nDelete multiple documents on filter.\n\n```clojure\n(delete-documents! settings \"companies\" {:filter_by \"num_employees:\u003e=100\"})\n\n;; Example success response =\u003e\n{:num_deleted 2}\n```\n\n### Export documents\n\nExport documents in collection.\n\n```clojure\n(export-documents settings \"companies\" {:filter_by \"num_employees:\u003e=100\"})\n\n;; Example success response =\u003e\n[{:id \"1\"\n  :company_name \"Innovationsoft A/S\"\n  :num_employees 10\n  :country \"Finland\"}]\n```\n\n## Search\n\nSearch for documents in a collection. You can find all the query arguments [here.](https://typesense.org/docs/28.0/api/documents.html#arguments)\n\n```clojure\n(search settings \"companies\" {:q \"Innovation\"\n                              :query_by \"company_name\"})\n\n;; Example success response =\u003e\n {:facet_counts []\n :found 1\n :hits\n [{:document\n   {:company_name \"Innovationsoft A/S\"\n    :country \"Finland\"\n    :id \"1\"\n    :num_employees 10}\n   :highlight\n   {:company_name\n    {:matched_tokens [\"Innovation\"]\n     :snippet \"\u003cmark\u003eInnovation\u003c/mark\u003esoft A/S\"}}\n   :highlights\n   [{:field \"company_name\"\n     :matched_tokens [\"Innovation\"]\n     :snippet \"\u003cmark\u003eInnovation\u003c/mark\u003esoft A/S\"}]\n   :text_match 578730089005449337\n   :text_match_info\n   {:best_field_score \"1108074561536\"\n    :best_field_weight 15\n    :fields_matched 1\n    :score \"578730089005449337\"\n    :tokens_matched 1}}]\n :out_of 1\n :page 1\n :request_params\n {:collection_name \"companies_documents_test\"\n  :per_page 10\n  :q \"Innovation\"}\n :search_cutoff false\n :search_time_ms 0}\n```\n\n## Multi search\n\nYou can send multiple search requests in a single HTTP request, using the Multi-Search feature. This is especially useful to avoid round-trip network latencies incurred otherwise if each of these requests are sent in separate HTTP requests. You can read more about multi-search [here.](https://typesense.org/docs/28.0/api/documents.html#federated-multi-search)\n\n```clojure\n(multi-search\n settings\n {:searches [{:collection \"products\"\n              :q \"shoe\"\n              :filter_by \"price:=[50..120]\"}\n             {:collection \"brands\"\n              :q \"Nike\"}]}\n {:query_by \"name\"})\n\n;; Example success response =\u003e\n{:results\n [{:facet_counts []\n   :found 1\n   :hits\n   [{:document {:id \"1\" :name \"shoe\" :price 75}\n     :highlight\n     {:name {:matched_tokens [\"shoe\"] :snippet \"\u003cmark\u003eshoe\u003c/mark\u003e\"}}\n     :highlights\n     [{:field \"name\"\n       :matched_tokens [\"shoe\"]\n       :snippet \"\u003cmark\u003eshoe\u003c/mark\u003e\"}]\n     :text_match 578730123365711993\n     :text_match_info\n     {:best_field_score \"1108091339008\"\n      :best_field_weight 15\n      :fields_matched 1\n      :score \"578730123365711993\"\n      :tokens_matched 1}}]\n   :out_of 1\n   :page 1\n   :request_params\n   {:collection_name \"products_multi_search_test\"\n    :per_page 10\n    :q \"shoe\"}\n   :search_cutoff false\n   :search_time_ms 0}\n  {:facet_counts []\n   :found 1\n   :hits\n   [{:document {:id \"1\" :name \"Nike\"}\n     :highlight\n     {:name {:matched_tokens [\"Nike\"] :snippet \"\u003cmark\u003eNike\u003c/mark\u003e\"}}\n     :highlights\n     [{:field \"name\"\n       :matched_tokens [\"Nike\"]\n       :snippet \"\u003cmark\u003eNike\u003c/mark\u003e\"}]\n     :text_match 578730123365711993\n     :text_match_info\n     {:best_field_score \"1108091339008\"\n      :best_field_weight 15\n      :fields_matched 1\n      :score \"578730123365711993\"\n      :tokens_matched 1}}]\n   :out_of 1\n   :page 1\n   :request_params\n   {:collection_name \"brands_multi_search_test\"\n    :per_page 10\n    :q \"Nike\"}\n   :search_cutoff false\n   :search_time_ms 0}]}\n```\n\n## Geosearch\n\n```clojure\n;; Create collection for geosearch with document.\n(let [schema {:name \"places\"\n              :fields [{:name \"title\" :type \"string\"}\n                       {:name \"points\" :type \"int32\"}\n                       {:name \"location\" :type \"geopoint\"}]\n              :default_sorting_field \"points\"}\n      document {:points 1\n                :title \"Louvre Museuem\"\n                :location [48.86093481609114 2.33698396872901]}]\n  (create-collection! settings schema)\n  (create-document! settings \"places\" document))\n\n;; Search\n(search settings\n        \"places\"\n        {:q \"*\"\n         :query_by \"title\"\n         :filter_by \"location:(48.90615915923891 2.3435897727061175 5.1 km)\"\n         :sort_by \"location(48.853 2.344):asc\"})\n\n;; Example success response =\u003e\n{:facet_counts []\n :found 1\n :hits\n [{:document\n   {:id \"0\"\n    :location [48.86093481609114 2.33698396872901]\n    :points 1\n    :title \"Louvre Museuem\"}\n   :geo_distance_meters {:location 1020}\n   :highlight {}\n   :highlights []}]\n :out_of 1\n :page 1\n :request_params {:collection_name \"places\" :per_page 10 :q \"*\"}\n :search_cutoff false}\n```\n\n## Api keys\n\nTypesense allows you to create API Keys with fine-grain access control. You can restrict access on both a per-collection and per-action level, [read more here](https://typesense.org/docs/28.0/api/api-keys.html#create-an-api-key)\n\n### Create api key\n\n```clojure\n(create-api-key! settings {:description \"Search only companies key.\"\n                           :actions [\"document:search\"]\n                           :collections [\"companies\"]})\n\n;; Example response =\u003e\n{:actions [\"document:search\"]\n :collections [\"companies\"]\n :description \"Search only companies key.\"\n :expires_at 64723363199\n :autodelete false\n :id 0\n :value \"sK0jo6CSn1EBoJJ8LKPjRZCtsJ1JCFkt\"}\n```\n\n### Retrieve api key\n\nRetrieves api key on `id`.\n\n```clojure\n(retrieve-api-key settings 0)\n\n;; Example response =\u003e\n{:actions [\"document:search\"]\n :collections [\"companies\"]\n :description \"Search only companies key.\"\n :expires_at 64723363199\n :autodelete false\n :id 0\n :value_prefix \"vLbB\"}\n```\n\n### List api keys\n\nList all api keys.\n\n```clojure\n(list-api-keys settings)\n\n;; Example response =\u003e\n{:keys [{:actions [\"document:search\"]\n         :collections [\"companies\"]\n         :description \"Search only companies key.\"\n         :expires_at 64723363199\n         :autodelete false\n         :id 0\n         :value_prefix \"vLbB\"}]}\n```\n\n### Delete api key\n\nDeletes api key on `id`.\n\n```clojure\n(delete-api-key! settings 0)\n\n;; Example success response =\u003e\n{:id 0}\n```\n\n## Curation\n\nUsing overrides, you can include or exclude specific documents for a given query, read more [here.](https://typesense.org/docs/28.0/api/curation.html)\n\n### Create or update an override\n\nCreate or update override if already exist.\n\n```clojure\n(upsert-override! settings\n                  \"companies\"\n                  \"customize-apple\"\n                  {:rule {:query \"apple\"\n                          :match \"exact\"}\n                   :includes [{:id \"422\" :position 1}\n                              {:id \"54\" :position 2}]\n                   :excludes [{:id \"287\"}]})\n\n;; Examples success response =\u003e\n{:excludes [{:id \"287\"}]\n :id \"customize_apple\"\n :includes [{:id \"422\" :position 1} {:id \"54\" :position 2}]\n :rule {:match \"exact\" :query \"apple\"}}\n```\n\n### List overrides\n\nList all overrides.\n\n```clojure\n(list-overrides settings \"companies\")\n\n;; Example success response =\u003e\n{:overrides\n [{:excludes [{:id \"287\"}]\n   :filter_curated_hits false\n   :id \"customize_apple\"\n   :includes [{:id \"422\" :position 1} {:id \"54\" :position 2}]\n   :remove_matched_tokens false\n   :rule {:match \"exact\" :query \"apple\"}\n   :stop_processing true}]}\n```\n\n### Retrieve override\n\nRetrieves override on name.\n\n```clojure\n(retrieve-override settings \"companies\" \"customize-apple\")\n\n;; Example success response =\u003e\n{:excludes [{:id \"287\"}]\n :filter_curated_hits false\n :id \"customize_apple\"\n :includes [{:id \"422\" :position 1} {:id \"54\" :position 2}]\n :remove_matched_tokens false\n :rule {:match \"exact\" :query \"apple\"}\n :stop_processing true}\n```\n\n### Delete override\n\nDeletes override on name.\n\n```clojure\n(delete-override! settings \"companies\" \"customize-apple\")\n\n;; Example success response =\u003e\n{:id \"customize_apple\"}\n```\n\n## Collection alias\n\nAn alias is a virtual collection name that points to a real collection. Read more [here](https://typesense.org/docs/28.0/api/collection-alias.html)\n\n### Create or update alias\n\nCreate or update alias.\n\n```clojure\n(upsert-alias! settings \"companies\" {:collection_name \"companies_june11\"})\n\n;; Example success response =\u003e\n{:collection_name \"companies_june11\" :name \"companies\"}\n```\n\n### Retrieve alias\n\nRetrieve alias on collection-name.\n\n```clojure\n(retrieve-alias settings \"companies\")\n\n;; Example success response =\u003e\n{:collection_name \"companies_alias_test\" :name \"companies\"}\n```\n\n### List aliases\n\nList aliases.\n\n```clojure\n(list-aliases settings)\n\n;; Example success response =\u003e\n{:aliases [{:collection_name \"companies_alias_test\" :name \"companies\"}]}\n```\n\n### Delete alias\n\nDelete alias on collection name.\n\n```clojure\n(delete-alias! settings \"companies\")\n\n;; Example success response =\u003e\n{:collection_name \"companies_alias_test\" :name \"companies\"}\n```\n\n## Synonyms\n\nThe synonyms feature allows you to define search terms that should be considered equivalent, read more [here.](https://typesense.org/docs/28.0/api/synonyms.html)\n\n### Create or update synonym\n\nCreate or update synonym.\n\n```clojure\n(upsert-synonym! settings \"products\" \"coat-synonyms\" {:synonyms [\"blazer\" \"coat\" \"jacket\"]})\n\n;; Example success response =\u003e\n{:id \"coat-synonyms\" :synonyms [\"blazer\" \"coat\" \"jacket\"]}\n```\n\n### Retrieve synonym\n\nRetrieve synonym on synonym name in collection.\n\n```clojure\n(retrieve-synonym settings \"products\" \"coat-synonyms\")\n\n;; Example success response =\u003e\n{:id \"coat-synonyms\" :root \"\" :synonyms [\"blazer\" \"coat\" \"jacket\"]}\n```\n\n### List synonyms\n\nList synonyms in collection.\n\n```clojure\n(list-synonyms settings \"products\")\n\n;; Example success response =\u003e\n{:synonyms [{:id \"coat-synonyms\" :root \"\" :synonyms [\"blazer\" \"coat\" \"jacket\"]}]}\n```\n\n### Delete synonym\n\nDelete synonym on synonym-name in collection.\n\n```clojure\n(delete-synonym! settings \"products\" \"coat-synonyms\")\n\n;; Example success response =\u003e\n{:id \"coat-synonyms\"}\n```\n\n## Cluster operations\n\n### Health\n\nGet health information about a Typesense node.\n\n```clojure\n(health settings)\n\n;; Example success response =\u003e\n{:ok true}\n```\n\n### Metrics\n\nGet current RAM, CPU, Disk \u0026 Network usage metrics.\n\n```clojure\n(metrics settings)\n\n;; Example success response =\u003e\n{:system_cpu8_active_percentage \"0.00\",\n :system_cpu12_active_percentage \"9.09\",\n :typesense_memory_allocated_bytes \"87053184\",\n :system_cpu5_active_percentage \"9.09\",\n :system_network_sent_bytes \"475775\",\n :system_cpu3_active_percentage \"0.00\",\n :system_cpu9_active_percentage \"0.00\",\n :typesense_memory_resident_bytes \"97734656\",\n :system_cpu_active_percentage \"3.77\",\n :system_memory_used_bytes \"5583503360\",\n :system_cpu14_active_percentage \"9.09\",\n :system_cpu15_active_percentage \"0.00\",\n :system_cpu6_active_percentage \"0.00\",\n :system_cpu10_active_percentage \"10.00\",\n :system_network_received_bytes \"585752\",\n :system_cpu13_active_percentage \"0.00\",\n :system_cpu11_active_percentage \"0.00\",\n :system_disk_total_bytes \"16782462976\",\n :typesense_memory_metadata_bytes \"28598544\",\n :system_cpu4_active_percentage \"10.00\",\n :system_cpu16_active_percentage \"0.00\",\n :typesense_memory_fragmentation_ratio \"0.11\",\n :system_disk_used_bytes \"24072192\",\n :system_memory_total_bytes \"33564925952\",\n :typesense_memory_mapped_bytes \"255479808\",\n :system_cpu2_active_percentage \"18.18\",\n :system_cpu1_active_percentage \"9.09\",\n :typesense_memory_retained_bytes \"80064512\",\n :system_cpu7_active_percentage \"0.00\",\n :typesense_memory_active_bytes \"97734656\"}\n```\n\n### Stats\n\nGet stats about API endpoints.\nReturns average requests per second and latencies for all requests in the last 10 seconds.\n\n```clojure\n(stats settings)\n\n;; Example success response =\u003e\n{:import_latency_ms 0\n :write_requests_per_second 0\n :import_requests_per_second 0\n :write_latency_ms 0\n :latency_ms {}\n :pending_write_batches 0\n :search_requests_per_second 0\n :delete_requests_per_second 0\n :search_latency_ms 0\n :requests_per_second {}\n :total_requests_per_second 0.0\n :overloaded_requests_per_second 0\n :delete_latency_ms 0}\n ```\n\n## Exceptions\n\n### Typesense API Errors\n\nTypesense API exceptions in the [Typesense-api-errors](https://typesense.org/docs/28.0/api/api-errors.html) spec.\n\n| Type                                      | Description                                                                |\n|:------------------------------------------|:---------------------------------------------------------------------------|\n| `:typesense.client/bad-request`           | Bad Request - The request could not be understood due to malformed syntax. |\n| `:typesense.client/unauthorized`          | Unauthorized - Your API key is wrong.                                      |\n| `:typesense.client/not-found`             | Not Found - The requested resource is not found.                           |\n| `:typesense.client/conflict`              | Conflict - When a resource already exists.                                 |\n| `:typesense.client/unprocessable-entity`  | Unprocessable Entity - Request is well-formed, but cannot be processed.    |\n| `:typesense.client/service-unavailable`   | Service Unavailable - We’re temporarily offline. Please try again later.   |\n| `:typesense.client/unspecified-api-error` | If Typesense throws an error that is not specified in the spec.            |\n\n\n## Development\n\n### Tests\n\n#### Run unit tests\n\nThe following command runs only unit tests.\n\n```sh\nbin/kaocha unit\n```\n\n#### Run integration tests\n\nTo run the integration tests you can run a local docker instance with the following command. This will start a instance of Typesense on `localhost:8108`. The Typesense instance will be cleaned before starting the integration tests.\n\n```sh\ndocker run -p 8108:8108 -v/tmp/data:/data typesense/typesense:28.0 --data-dir /data --api-key=key\n```\n\nThe following command runs only the integration tests.\n\n```sh\nbin/kaocha integration\n```\n\n#### Run all the tests.\n\nThe following command runs all tests.\n\n```sh\nbin/kaocha\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruneanielsen%2Ftypesense-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruneanielsen%2Ftypesense-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruneanielsen%2Ftypesense-clj/lists"}