#community-help

Issue with PATCH Request in Typesense

TLDR Saurabh is trying to update data using a PATCH request, but receives a "not found" message. Jason confirms the request looks fine and asks for the Typesense version being used.

Powered by Struct AI
Jun 07, 2023 (6 months ago)
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
01:25 PM
Image 1 for
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:11 PM
If you’re using curl / postman, it’s a PATCH request, not a PUT request
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
06:38 PM
it still says not found as a message
06:39
Saurabh
06:39 PM
url = "<http://url/collections/program/documents?filter_by=id:64807bc70d6f083179a601a4>"

payload = json.dumps({
"costs": {
"currency": "USD"
}
})
06:40
Saurabh
06:40 PM
basically i need update by query
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:47 PM
Could you copy the request as CURL from postman and post it here?
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
07:20 PM
curl --location --globoff --request PATCH '{{url}}/collections/program/documents?filter_by=id%3A64807bc70d6f083179a601a4' \
--header 'Content-Type: application/json' \
--header 'X-TYPESENSE-API-KEY: {{TYPESENSE_API_KEY}}' \
--data '{
    "costs": {
        "currency": "USD"
    }
}'
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:43 PM
That seems fine, could you confirm that you’re running v0.25.0.rc14 or above?

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

Updating Documents and Fixing Error in Prod Environment

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.

1

15
5mo

Manually Invalidating Cache in Typesense NPM Package Unsuccessful

Slavik asked about manually invalidating cache, with Kishore Nallan and Jason providing possible methods. These solutions did not resolve Slavik's issue, who was advised to open a GitHub issue for further investigation.

14
5mo

Typesense Server Bulk Import/Upsert Issue Resolved

Adam was confused about the discrepancy between the successful responses and the actual indexed data while working with a custom WP plugin integrating with Typesense. The issue was a bug related to fetching documents in the wrong order, not a Typesense problem.

2

22
7mo

Troubleshooting Typesense Connection Issue and Data Retrieval

Felix encountered issues connecting to a server-created typesense and retrieving data collections. Kishore Nallan and Jason provided guidance, highlighting errors in the original code and suggesting changes to the URL and curl command.

63
24mo

Issues with Importing Typesense Collection to Different Server

Kevin had problems migrating a Typesense collection between Docusaurus sites on different machines. Jason advised them on JSONL format, handling server hosting, and creating a collection schema before importing documents, leading to successful import.

3

35
3mo