#community-help

Updating Documents and Fixing Error in Prod Environment

TLDR sahubar asked to update documents except for certain id fields. Kishore Nallan shared a future feature addressing this. Then, sahubar encountered an error in their prod environment. Kishore Nallan provided potential reasons and a temporary solution.

Powered by Struct AI

1

Jul 01, 2023 (5 months ago)
sahubar
Photo of md5-41ca8b93efee2249950bdd80b036a9dc
sahubar
10:31 AM
Greetings of the day...

Hi Jason / Kishore Nallan
if possible update the document except for the id field like (product_id,item_code,model_code ) it could be better for multiple update documents based some other fields
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:38 AM
You want to update some fields based on a filter condition?
sahubar
Photo of md5-41ca8b93efee2249950bdd80b036a9dc
sahubar
10:40 AM
thanks, for the quick reply Kishore Nallan
yes i need update documents except id field
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:43 AM
Feature is available in upcoming 0.25 release. Example:

export FILTER_CLAUSE="points:1000"
curl "" -X PATCH \
        -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{"title": "Title with 1000 points."}'

The above will update the title of all documents that has a points field value of 1000.

Is this what you want?
sahubar
Photo of md5-41ca8b93efee2249950bdd80b036a9dc
sahubar
10:53 AM
yes Kishore Nallan its working fine thanks for the update

1

11:01
sahubar
11:01 AM
Kishore Nallan below mentioned error thows prod environment

{
"message": "Not Ready or Lagging"
}
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:02 AM
What command did you run?
sahubar
Photo of md5-41ca8b93efee2249950bdd80b036a9dc
sahubar
11:05 AM
curl --location --request PATCH 'https://mycluter.typesense.net/collections/myproducts/documents?filter_by=mymodel_code:"gripp-focal-camera-lens-2-in1-protection-tempered-glass-for-apple-iphone-14-14-plus"' \
--header 'X-TYPESENSE-API-KEY: mytypesensekey' \
--header 'Content-Type: application/json' \
--data-raw '{
"rating": 5,
"review_count" : 81
}'
11:06
sahubar
11:06 AM
i have tried dev and stage its working but my prod its throws error above mentioned
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:10 AM
Commands that touch the whole cluster can take some time to finish
sahubar
Photo of md5-41ca8b93efee2249950bdd80b036a9dc
sahubar
11:12 AM
ok Kishore Nallan i will check and revert back to you
11:14
sahubar
11:14 AM
FYI
Image 1 for FYI
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:15 AM
Try again now.
11:16
Kishore Nallan
11:16 AM
There was probably a bad query that was hogging the CPU. We have better mechanism for this in recent builds. I've fixed this for you for now.
11:17
Kishore Nallan
11:17 AM
I see all requests being sent to only 1 node on your cluster.

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads

Typesense Bug Fix with `canceled_at` Field and Upgrade Concerns

Mateo reported an issue regarding the treatment of an optional field by Typesense which was confirmed a bug by Jason. After trying an upgrade, an error arose. Jason explained the bug was due to a recent change and proceeded to downgrade their version. Future upgrade protocols were discussed.

3

74
10mo

Handling Kinesis Stream Event Batching with Typesense

Dui had questions about how to handle Kinesis stream events with Typesense. Kishore Nallan suggested using upsert mode for creation/update and differentiating with logical deletion. After various discussions including identifying and resolving a bug, they finalized to introduce an `emplace` action in Typesense v0.23.

8

91
24mo

Issue with Embedding Error in Version 0.25.0.rc63

Bill reported a bug in version 0.25.0.rc63 regarding a problem with updating or emplacing a document and receiving an embedding error. This was resolved in version 0.25.0.rc65, but further discussion ensued regarding the function of 'index' in the update feature.

5

63
4mo

Updating Bulk Records and Resolving Typsense Issues.

Greg inquired about updating bulk records. Jason proposed using the documents/import endpoint for bulk updating, identified issues with Typesense, and provided solutions. Greg appreciated the assistance. Conversation related to the procedure was shared with Viktor.

8

63
13mo

Troubleshooting Issues with DocSearch Hits and Scraper Configuration

Rubai encountered issues with search result priorities and ellipsis. Jason helped debug the issue and suggested using different versions of typesense-docsearch.js, updating initialization parameters, and running the scraper on a Linux-based environment. The issues related to hits structure and scraper configuration were resolved.

7

131
8mo