You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/06-model.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,9 @@ We provide some builtin models to use directly.
17
17
18
18
We support importing models using [Hugging Face](https://huggingface.co/) config. You can use the `create_huggingface_model` function to import a model.
Copy file name to clipboardExpand all lines: docs/07-limitation.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,16 @@
5
5
`pg_tokenizer` will cache `text analyzer`, `model` and `tokenizer` object in memory for each connection. The cache will always be updated when calling `create_...`, `drop_...` functions. And it doesn't follow transaction isolation level.
6
6
7
7
The cache may not be cleared when you rollback a transaction. You may need to call `drop_...` functions manually or reconnect to the database to clear the cache.
8
+
9
+
Example:
10
+
11
+
```sql
12
+
BEGIN;
13
+
SELECT create_text_analyzer('text_analyzer1', $$
14
+
pre_tokenizer ="unicode_segmentation"
15
+
$$);
16
+
-- The text analyzer is created and cached in memory
17
+
ROLLBACK;
18
+
-- The text analyzer is still cached in memory, but no effect for other connections
19
+
SELECT drop_text_analyzer('text_analyzer1'); -- extra call to clear the cache
0 commit comments