Skip to content

Commit 402ccbc

Browse files
authored
Fix typos and added operations API clear cache, compact db, toggle slow request log (#101)
* fix typos * feat: added operations clear cache * feat: added operations compact db * feat: operations API toggle slow request log
1 parent b1c31a9 commit 402ccbc

File tree

1 file changed

+63
-3
lines changed

1 file changed

+63
-3
lines changed

openapi.yml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ paths:
814814
get:
815815
tags:
816816
- documents
817-
summary: Retreive a document
817+
summary: Retrieve a document
818818
description: Fetch an individual document from a collection by using its ID.
819819
operationId: getDocument
820820
parameters:
@@ -1343,6 +1343,66 @@ paths:
13431343
application/json:
13441344
schema:
13451345
$ref: "#/components/schemas/SuccessStatus"
1346+
/operations/cache/clear:
1347+
post:
1348+
tags:
1349+
- operations
1350+
summary: Clear the cached responses of search requests in the LRU cache.
1351+
description:
1352+
Clear the cached responses of search requests that are sent with `use_cache` parameter in the LRU cache.
1353+
operationId: clearCache
1354+
responses:
1355+
'200':
1356+
description: Clear cache succeeded.
1357+
content:
1358+
application/json:
1359+
schema:
1360+
$ref: "#/components/schemas/SuccessStatus"
1361+
/operations/db/compact:
1362+
post:
1363+
tags:
1364+
- operations
1365+
summary: Compacting the on-disk database
1366+
description:
1367+
Typesense uses RocksDB to store your documents on the disk. If you do frequent writes or updates, you could benefit from running a compaction of the underlying RocksDB database.
1368+
This could reduce the size of the database and decrease read latency. While the database will not block during this operation, we recommend running it during off-peak hours.
1369+
operationId: compactDb
1370+
responses:
1371+
'200':
1372+
description: Compacting the on-disk database succeeded.
1373+
content:
1374+
application/json:
1375+
schema:
1376+
$ref: "#/components/schemas/SuccessStatus"
1377+
/config:
1378+
post:
1379+
tags:
1380+
- operations
1381+
summary: Toggle Slow Request Log
1382+
description:
1383+
Enable logging of requests that take over a defined threshold of time.
1384+
Default is `-1` which disables slow request logging.
1385+
Slow requests are logged to the primary log file, with the prefix SLOW REQUEST.
1386+
operationId: toggleSlowRequestLog
1387+
requestBody:
1388+
content:
1389+
application/json:
1390+
schema:
1391+
type: object
1392+
properties:
1393+
log-slow-requests-time-ms:
1394+
type: integer
1395+
required:
1396+
- log-slow-requests-time-ms
1397+
example: |
1398+
{"log-slow-requests-time-ms": 2000}
1399+
responses:
1400+
'200':
1401+
description: Compacting the on-disk database succeeded.
1402+
content:
1403+
application/json:
1404+
schema:
1405+
$ref: "#/components/schemas/SuccessStatus"
13461406
/multi_search:
13471407
post:
13481408
operationId: multiSearch
@@ -2941,7 +3001,7 @@ components:
29413001

29423002
filter_by:
29433003
description:
2944-
Filter conditions for refining youropen api validator search results. Separate
3004+
Filter conditions for refining your open api validator search results. Separate
29453005
multiple conditions with &&.
29463006
type: string
29473007
example: "num_employees:>100 && country: [USA, UK]"
@@ -3981,7 +4041,7 @@ components:
39814041
description: >
39824042
Dictates the direction in which the words in the query must be dropped when the original words in the query do not appear in any document.
39834043
Values: right_to_left (default), left_to_right, both_sides:3
3984-
A note on both_sides:3 - for queries upto 3 tokens (words) in length, this mode will drop tokens from both sides and exhaustively rank all matching results.
4044+
A note on both_sides:3 - for queries up to 3 tokens (words) in length, this mode will drop tokens from both sides and exhaustively rank all matching results.
39854045
If query length is greater than 3 words, Typesense will just fallback to default behavior of right_to_left
39864046
ConversationModelCreateSchema:
39874047
required:

0 commit comments

Comments
 (0)