Skip to content

Commit 7b1c112

Browse files
authored
Update README.md
1 parent f529fdc commit 7b1c112

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

README.md

+32-9
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,43 @@ Running tests:
1818

1919
zig build test --summary all
2020

21-
## Using via HTTP API
21+
## HTTP API
2222

23-
Create index:
23+
### Create index
2424

25-
curl -XPUT -v http://localhost:8080/indexname
25+
Creates a new index.
2626

27-
Add a fingerprint:
27+
```
28+
PUT /:indexname
29+
```
2830

29-
curl -XPOST -d '{"changes": [{"insert": {"id": 1, "hashes": [1,2,3]}}]}' -v http://localhost:8080/indexname/_update
31+
### Delete index
3032

31-
Delete a fingerprint:
33+
Deletes an index.
3234

33-
curl -XPOST -d '{"changes": [{"delete": {"id": 2}}]}' -v http://localhost:8080/indexname/_update
35+
```
36+
DELETE /:indexname
37+
```
3438

35-
Search for a fingerprint:
39+
### Update
3640

37-
curl -XPOST -d '{"query": [1,2,3], "timeout": 10}' -v http://localhost:8080/indexname/_search
41+
Performs multiple operations on an index.
42+
43+
```
44+
POST /:indexname/_update
45+
{
46+
"changes": [
47+
{"insert": {"id": 1, "hashes": [100, 200, 300]}},
48+
{"delete": {"id": 2},
49+
]
50+
}
51+
```
52+
53+
### Search
54+
55+
Searches for a fingerprint in the index.
56+
57+
```
58+
POST /:indexname/_search
59+
{"query": [100, 200, 300], "timeout": 10}
60+
```

0 commit comments

Comments
 (0)