typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
414 stars 75 forks source link

feat: add cache/clear to list of known operations #136

Closed wodCZ closed 2 years ago

wodCZ commented 2 years ago

Adds cache/clear option to the operation union type, to indicate it's existence.

This makes use of the existing operation endpoint here: https://github.com/typesense/typesense/blob/483ed4d533e8a657784472e3a3066298fa085c44/src/main/typesense_server.cpp#L77

It is, unfortunately, an undocumented flow. One that complements the usage of useServerSideSearchCache on the client side.

It would be really helpful to document that the use of the useServerSideSearchCache, or it's direct API dependant, use_cache (link), stores the result in memory, and can be cleared using the cache/clear operation when the immediate propagation of document update is needed.

jasonbosco commented 2 years ago

Thank you @wodCZ! We need to document this in docs-site as well!

jasonbosco commented 2 years ago

Published this in v1.4.2