Skip to content

Fix import and document update functions#71

Open
DavidWeiss2 wants to merge 2 commits into
typesense:node-18-upgradefrom
DavidWeiss2:fix/extention-failing-on-created-documents-or-documents-without-all-fields
Open

Fix import and document update functions#71
DavidWeiss2 wants to merge 2 commits into
typesense:node-18-upgradefrom
DavidWeiss2:fix/extention-failing-on-created-documents-or-documents-without-all-fields

Conversation

@DavidWeiss2

Copy link
Copy Markdown
Contributor

Improved Stability in Import and Document Update Operations

This pull request addresses and resolves issues in the import and document update functionalities. The changes implemented aim to enhance the stability and reliability of document writes, significantly reducing the occurrence of failures.

Key Changes:

  • Optimized the import function for better handling of various document formats.
  • Refined the document update mechanism to decrease the likelihood of write failures.

These improvements are expected to offer a more seamless and efficient experience for all users. Your testing and feedback on these changes would be greatly appreciated to ensure we maintain the high standards of the project.

@jasonbosco jasonbosco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments

Comment thread functions/src/utils.js
action: "emplace",
dirty_values: "coerce_or_drop",
return_doc: false,
batch_size: batchSize.length,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The batch_size here controls server-side batching, and we do not want to change this from the default in most cases.

Could you remove this?

Comment thread functions/src/utils.js
exports.importDocumentsConfig = (batchSize) => ({
action: "emplace",
dirty_values: "coerce_or_drop",
return_doc: false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good improvement, I've seen users miss the error returned because we log the document as well.

But could you instead set return_id: true, so at least the document ID is logged for users to investigate further?

…-on-created-documents-or-documents-without-all-fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants