Skip to content

Commit 4b53a32

Browse files
authored
add support for typesense 0.23.0 (#34)
1 parent 5a7a59b commit 4b53a32

File tree

3 files changed

+174
-107
lines changed

3 files changed

+174
-107
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ executors:
1313
auth:
1414
username: $DOCKER_LOGIN
1515
password: $DOCKER_ACCESSTOKEN
16-
- image: typesense/typesense:0.22.2 # For integration testing
16+
- image: typesense/typesense:0.23.0 # For integration testing
1717
auth:
1818
username: $DOCKER_LOGIN
1919
password: $DOCKER_ACCESSTOKEN

README.md

Lines changed: 88 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Clojars Project](https://img.shields.io/clojars/v/io.github.runeanielsen/typesense-clj.svg)](https://clojars.org/io.github.runeanielsen/typesense-clj)
44

5-
Clojure client for [Typesense 0.22](https://github.com/typesense/typesense)
5+
Clojure client for [Typesense 0.23](https://github.com/typesense/typesense)
66

77
All 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.
88

@@ -22,11 +22,11 @@ Example of settings.
2222

2323
## Collection
2424

25-
This section describes how to use the collection, further information can be found [here.](https://typesense.org/docs/0.22.2/api/collections.html#create-a-collection)
25+
This section describes how to use the collection, further information can be found [here.](https://typesense.org/docs/0.23.0/api/collections.html#create-a-collection)
2626

2727
### Create collection
2828

29-
The different `types` for the schema can be found [here](https://typesense.org/docs/0.22.2/api/collections.html#create-a-collection).
29+
The different `types` for the schema can be found [here](https://typesense.org/docs/0.23.0/api/collections.html#create-a-collection).
3030

3131
The examples displays the creation of collection named `companies`.
3232

@@ -42,25 +42,33 @@ The examples displays the creation of collection named `companies`.
4242
:default_sorting_field "num_employees"})
4343

4444
;; Example success response =>
45-
{:created_at 1647252992
46-
:default_sorting_field "num_employees"
45+
{:default_sorting_field "num_employees"
4746
:fields [{:facet false
4847
:index true
4948
:name "company_name"
5049
:optional false
51-
:type "string"}
50+
:type "string"
51+
:infix false
52+
:locale ""
53+
:sort false}
5254
{:facet false
5355
:index true
5456
:name "num_employees"
5557
:optional false
56-
:type "int32"}
58+
:type "int32"
59+
:infix false
60+
:locale ""
61+
:sort true}
5762
{:facet true
5863
:index true
5964
:name "country"
6065
:optional false
61-
:type "string"}]
62-
:name "companies"
63-
:num_documents 0
66+
:type "string"
67+
:infix false
68+
:locale ""
69+
:sort false}]
70+
:name "companies_collection_test"
71+
:num_documents 0
6472
:symbols_to_index []
6573
:token_separators []}
6674
```
@@ -106,26 +114,35 @@ Returns a summary of all your collections. The collections are returned sorted b
106114
(list-collections settings)
107115

108116
;; Example success response =>
109-
[{:default_sorting_field "num_employees"
110-
:fields [{:facet false
111-
:index true
112-
:name "company_name"
113-
:optional false
114-
:type "string"}
115-
{:facet false
116-
:index true
117-
:name "num_employees"
118-
:optional false
119-
:type "int32"}
120-
{:facet true
121-
:index true
122-
:name "country"
123-
:optional false
124-
:type "string"}]
125-
:name "companies_collection_test"
126-
:num_documents 0
127-
:symbols_to_index []
128-
:token_separators []}]
117+
{:default_sorting_field "num_employees"
118+
:fields [{:facet false
119+
:index true
120+
:name "company_name"
121+
:optional false
122+
:type "string"
123+
:infix false
124+
:locale ""
125+
:sort false}
126+
{:facet false
127+
:index true
128+
:name "num_employees"
129+
:optional false
130+
:type "int32"
131+
:infix false
132+
:locale ""
133+
:sort true}
134+
{:facet true
135+
:index true
136+
:name "country"
137+
:optional false
138+
:type "string"
139+
:infix false
140+
:locale ""
141+
:sort false}]
142+
:name "companies_collection_test"
143+
:num_documents 0
144+
:symbols_to_index []
145+
:token_separators []}
129146
```
130147

131148
### Retrieve collection
@@ -137,31 +154,39 @@ Retrieves the collection on the `collection-name`.
137154

138155
;; Example success response =>
139156
{:default_sorting_field "num_employees"
140-
:fields
141-
[{:facet false
142-
:index true
143-
:name "company_name"
144-
:optional false
145-
:type "string"}
146-
{:facet false
147-
:index true
148-
:name "num_employees"
149-
:optional false
150-
:type "int32"}
151-
{:facet true
152-
:index true
153-
:name "country"
154-
:optional false
155-
:type "string"}]
156-
:name "companies"
157+
:fields [{:facet false
158+
:index true
159+
:infix false
160+
:locale ""
161+
:name "company_name"
162+
:optional false
163+
:sort false
164+
:type "string"}
165+
{:facet false
166+
:index true
167+
:infix false
168+
:locale ""
169+
:name "num_employees"
170+
:optional false
171+
:sort true
172+
:type "int32"}
173+
{:facet true
174+
:index true
175+
:infix false
176+
:locale ""
177+
:name "country"
178+
:optional false
179+
:sort false
180+
:type "string"}]
181+
:name "companies_collection_test"
157182
:num_documents 0
158183
:symbols_to_index []
159184
:token_separators []}
160185
```
161186

162187
## Documents
163188

164-
This section describes how to use the documents, further information can be found [here.](https://typesense.org/docs/0.22.2/api/documents.html)
189+
This section describes how to use the documents, further information can be found [here.](https://typesense.org/docs/0.23.0/api/documents.html)
165190

166191
### Create document
167192

@@ -239,7 +264,7 @@ Update document in a collection on id. The update can be partial.
239264

240265
## Create/Upsert/Update/Delete Documents
241266

242-
Create/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/0.22.2/api/documents.html#import-documents)
267+
Create/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/0.23.0/api/documents.html#import-documents)
243268

244269
### Create documents
245270

@@ -318,7 +343,7 @@ Export documents in collection.
318343

319344
## Search
320345

321-
Search for documents in a collection. You can find all the query arguments [here.](https://typesense.org/docs/0.22.2/api/documents.html#arguments)
346+
Search for documents in a collection. You can find all the query arguments [here.](https://typesense.org/docs/0.23.0/api/documents.html#arguments)
322347

323348
```clojure
324349
(search settings "companies" {:q "Innovation"
@@ -350,7 +375,7 @@ Search for documents in a collection. You can find all the query arguments [here
350375

351376
## Multi search
352377

353-
You 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/0.22.2/api/documents.html#federated-multi-search)
378+
You 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/0.23.0/api/documents.html#federated-multi-search)
354379

355380
```clojure
356381
(multi-search settings
@@ -439,7 +464,7 @@ You can send multiple search requests in a single HTTP request, using the Multi-
439464

440465
## Api keys
441466

442-
Typesense 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/0.22.2/api/api-keys.html#create-an-api-key)
467+
Typesense 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/0.23.0/api/api-keys.html#create-an-api-key)
443468

444469
### Create api key
445470

@@ -502,7 +527,7 @@ Deletes api key on `id`.
502527

503528
## Curation
504529

505-
Using overrides, you can include or exclude specific documents for a given query, read more [here.](https://typesense.org/docs/0.22.2/api/curation.html)
530+
Using overrides, you can include or exclude specific documents for a given query, read more [here.](https://typesense.org/docs/0.23.0/api/curation.html)
506531

507532
### Create or update an override
508533

@@ -536,7 +561,9 @@ List all overrides.
536561
{:overrides [{:excludes [{:id "287"}]
537562
:id "customize_apple"
538563
:includes [{:id "422" :position 1} {:id "54" :position 2}]
539-
:rule {:match "exact" :query "apple"}}]}
564+
:rule {:match "exact" :query "apple"}
565+
:filter_curated_hits false
566+
:remove_matched_tokens false}]}
540567
```
541568

542569
### Retrieve override
@@ -550,7 +577,9 @@ Retrieves override on name.
550577
{:excludes [{:id "287"}]
551578
:id "customize_apple"
552579
:includes [{:id "422" :position 1} {:id "54" :position 2}]
553-
:rule {:match "exact" :query "apple"}}
580+
:rule {:match "exact" :query "apple"}
581+
:filter_curated_hits false
582+
:remove_matched_tokens false}
554583
```
555584

556585
### Delete override
@@ -566,7 +595,7 @@ Deletes override on name.
566595

567596
## Collection alias
568597

569-
An alias is a virtual collection name that points to a real collection. Read more [here](https://typesense.org/docs/0.22.2/api/collection-alias.html)
598+
An alias is a virtual collection name that points to a real collection. Read more [here](https://typesense.org/docs/0.23.0/api/collection-alias.html)
570599

571600
### Create or update alias
572601

@@ -614,7 +643,7 @@ Delete alias on collection name.
614643

615644
## Synonyms
616645

617-
The synonyms feature allows you to define search terms that should be considered equivalent, read more [here.](https://typesense.org/docs/0.22.2/api/synonyms.html)
646+
The synonyms feature allows you to define search terms that should be considered equivalent, read more [here.](https://typesense.org/docs/0.23.0/api/synonyms.html)
618647

619648
### Create or update synonym
620649

@@ -664,7 +693,7 @@ Delete synonym on synonym-name in collection.
664693

665694
### Typesense API Errors
666695

667-
Typesense API exceptions in the [Typesense-api-errors](https://typesense.org/docs/0.22.2/api/api-errors.html) spec.
696+
Typesense API exceptions in the [Typesense-api-errors](https://typesense.org/docs/0.23.0/api/api-errors.html) spec.
668697

669698
| Type | Description |
670699
|:------------------------------------------|:---------------------------------------------------------------------------|
@@ -694,7 +723,7 @@ bin/kaocha unit
694723
To 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.
695724

696725
```sh
697-
docker run -p 8108:8108 -v/tmp/data:/data typesense/typesense:0.22.2 --data-dir /data --api-key=key
726+
docker run -p 8108:8108 -v/tmp/data:/data typesense/typesense:0.23.0 --data-dir /data --api-key=key
698727
```
699728

700729
The following command runs only the integration tests.

0 commit comments

Comments
 (0)