Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
56be3b5
feat(config): add buffer configuration parameters
tharropoulos Apr 7, 2025
194d6fc
feat: implement buffer processing scheduler
tharropoulos Apr 7, 2025
093d064
chore: add max retries for buffer
tharropoulos Apr 7, 2025
312162a
refactor: move cron functionality to dedicated function for testing
tharropoulos Apr 7, 2025
843c7d4
fix: check for documents where the retry is equal to the maximum
tharropoulos Apr 7, 2025
9118dbd
refactor: change failedIds from set into a map
tharropoulos Apr 7, 2025
531c6b1
fix: log generic on import fails if not of type of ImportError
tharropoulos Apr 7, 2025
92d73aa
refactor: use last error for import fails
tharropoulos Apr 7, 2025
66a7160
refactor: change the logic order of max retries on imports
tharropoulos Apr 7, 2025
50edb65
fix: use the whole delete batch if num_deleted = 0
tharropoulos Apr 7, 2025
957a92b
fix: fix doc ref access on deletion fails
tharropoulos Apr 7, 2025
af9c88b
fix: use iterator for failed deletions instead of array.forEach
tharropoulos Apr 7, 2025
47a67f9
refactor: change failed deletions retry logic
tharropoulos Apr 7, 2025
87a2986
fix: init app on processBuffer
tharropoulos Apr 7, 2025
a54bfe6
feat(test): add support for custom typesense fields in TestEnvironment
tharropoulos Apr 7, 2025
cdb0408
test: add tests for buffer processing operations
tharropoulos Apr 7, 2025
52f9600
refactor: improve buffer processing code organization
tharropoulos Apr 7, 2025
595e463
chore: bump typesense dep
tharropoulos Apr 7, 2025
9c8e4c1
fix(test): remove double encoding on test environment
tharropoulos Apr 7, 2025
33343b2
chore: include typesense-data in gitignore
tharropoulos Apr 9, 2025
7862a33
chore: bump typesense
tharropoulos Apr 9, 2025
a49c08c
fix: remove double encoding of collection name
tharropoulos Apr 9, 2025
09d7c7b
build: read from environment vars for buffer operations
tharropoulos Apr 9, 2025
25d3c50
chore: add envs for buffers
tharropoulos Apr 9, 2025
373a481
fix(buffer): use the path snapshot params of the document when importing
tharropoulos Apr 9, 2025
92ab894
feat(buffering): add buffering option to `indexOnWrite`
tharropoulos Apr 9, 2025
aeabaee
test(buffer): test buffering on `indexOnWrite`
tharropoulos Apr 9, 2025
e7b523c
fix: change default buffer interval syntax
tharropoulos Apr 9, 2025
c1e1d07
build: add new env params to yaml file
tharropoulos Apr 9, 2025
f3c285f
chore: bump firebase deps
tharropoulos Apr 14, 2025
6988bb6
build: use ts v29.0.rc13 for ci
tharropoulos Apr 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ node_modules/
test-params.env
extensions/test-params.env
/typesense-server-data/
typesense-data
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typesense:
image: typesense/typesense:27.0
image: typesense/typesense:29.0.rc13
restart: on-failure
ports:
- "8108:8108"
Expand Down
45 changes: 45 additions & 0 deletions extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,48 @@ params:
value: true
default: false
required: false
- param: TYPESENSE_USE_BUFFER
label: Use Buffer for Typesense Operations
description: >-
Enable buffering for Typesense operations. Buffering can improve performance by batching operations
and providing retry capabilities for failed requests.
type: select
options:
- label: No
value: false
- label: Yes
value: true
default: false
required: false
- param: TYPESENSE_BUFFER_COLLECTION_IN_FIRESTORE
label: Typesense Buffer Collection in Firestore
description: >-
The Firestore collection name to use for buffering Typesense operations.
Only applicable if buffering is enabled.
example: typesense_buffer
default: typesense_buffer
required: false
- param: TYPESENSE_BUFFER_BATCH_SIZE
label: Typesense Buffer Batch Size
description: >-
The number of documents to process in a single batch when flushing the buffer.
Only applicable if buffering is enabled.
example: 100
default: 100
required: false
- param: TYPESENSE_BUFFER_MAX_RETRIES
label: Typesense Buffer Maximum Retries
description: >-
The maximum number of retry attempts for failed Typesense operations.
Only applicable if buffering is enabled.
example: 3
default: 3
required: false
- param: TYPESENSE_BUFFER_FLUSH_INTERVAL
label: Typesense Buffer Flush Interval
description: >-
The time interval in cron-style format at which the buffer should be automatically flushed.
Default is "every 3 minutes". Syntax is documented [here](https://cloud.google.com/appengine/docs/flexible/scheduling-jobs-with-cron-yaml#formatting_the_schedule). [Unix crontab](http://man7.org/linux/man-pages/man5/crontab.5.html) is also supported. Only applicable if buffering is enabled.
example: every 5 minutes
default: every 3 minutes
required: false
11 changes: 11 additions & 0 deletions extensions/test-params-buffer-enabled.local.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
LOCATION=us-central1
FIRESTORE_DATABASE_REGION=nam5
FIRESTORE_COLLECTION_PATH=books
FIRESTORE_COLLECTION_FIELDS=author,title,rating,isAvailable,location,createdAt,nested_field,tags,nullField,ref
FLATTEN_NESTED_DOCUMENTS=false
TYPESENSE_HOSTS=localhost
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_COLLECTION_NAME=books_firestore/1
TYPESENSE_API_KEY=xyz
TYPESENSE_USE_BUFFER=true
14 changes: 14 additions & 0 deletions extensions/test-params-subcategory-buffer-enabled.local.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
LOCATION=us-central1
FIRESTORE_DATABASE_REGION=nam5
FIRESTORE_COLLECTION_PATH=users/{personId}/books
TEST_FIRESTORE_PARENT_COLLECTION_PATH=users
TEST_FIRESTORE_PARENT_ID=123
TEST_FIRESTORE_CHILD_FIELD_NAME=books
FIRESTORE_COLLECTION_FIELDS=author,title,rating,isAvailable,location,createdAt,nested_field,tags,nullField,ref
FLATTEN_NESTED_DOCUMENTS=false
TYPESENSE_HOSTS=localhost
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_COLLECTION_NAME=books_firestore/1
TYPESENSE_API_KEY=xyz
TYPESENSE_USE_BUFFER=true
Loading