Difficulty Creating Override on Typesense's Curation API
TLDR Kor was facing trouble while creating an override on Typesense and not getting expected results. Jason assisted in debugging the issue, provided a fix with an upgrade, and confirmed some limitations regarding case sensitivity and bulk deletion of overrides.
2
Jul 26, 2023 (4 months ago)
Kor
01:06 PMI managed to import an override via curl, and I can see it show up in the Typesense's admin (in the browser).
This is the object I import:
'{
"rule": {
"query": "revoke digital certificates and manage public-key encryption",
"match": "exact"
},
"includes": [
{
"id": "30642",
"position": 1
}
]
}'
I was expecting to see the “id” back in the admin, but it is not there. If I remove “content” by clicking on the cross, the id shows in the empty field, but disappears again after saving. What am I doing wrong?
Jason
04:28 PMThat view should at least show the ID of the record, so need to take a closer look
Kor
04:36 PMJason
04:40 PMOn a side note, this is only a UI issue. The curation rule itself should work, since it only stores the ID of the document
Kor
04:41 PMKor
04:47 PMKor
05:02 PMJason
05:10 PMKor
05:19 PMJason
05:19 PMKor
05:20 PMJason
05:20 PMKor
05:21 PM1
Kor
05:25 PMJason
05:26 PMKor
05:27 PMJason
05:28 PMJason
05:28 PMJason
05:28 PMJason
05:28 PM> I set an override for “TEL” (and not necesserali “tel”?
Kor
05:29 PMKor
06:42 PMJason
06:43 PMYou could write a quick snippet to read all overrides and then send delete API calls one at a time to do this programatically
Kor
06:43 PMKor
06:52 PMBEGIN CHATGPT
#!/bin/bash
# Get all overrides
OVERRIDES=$(curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" "<http://localhost:8108/collections/companies/overrides>")
# Extract just the names from the overrides
OVERRIDE_NAMES=$(echo $OVERRIDES | jq -r '.overrides[] | .id')
# Loop over each override name and delete it
for OVERRIDE_NAME in $OVERRIDE_NAMES
do
curl "<http://localhost:8108/collections/companies/overrides/$OVERRIDE_NAME>" -X DELETE \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"
done
This script first sends a GET request to the Typesense API to retrieve all overrides. It then uses jq to extract just the IDs of each override into the OVERRIDE_NAMES variable. This is a space-separated list of all override names.
It then loops over each name in OVERRIDE_NAMES, sending a DELETE request to the Typesense API to delete that override.
Make sure to replace ${TYPESENSE_API_KEY} with your actual Typesense API key.
Please note that this will delete ALL overrides for the "companies" collection. If you have overrides that you don't want to delete, you will need to adjust the script to exclude those.
END CHATGPT
1
Typesense
Indexed 3011 threads (79% resolved)
Similar Threads
Troubleshooting 'Contains' Match and Override Issues in Typesense
John sought assistance due to a seemingly faulty override in Typesense that failed to bring up a specific entry. Jason suggested troubleshooting steps, including trying a smaller record set and considering a server upgrade. A bug with 'contains' match appeared identified but not conclusively resolved.
Resolving Issues with Infix and Prefix in Query Searches
Daren struggled with searches missing values in production. Jason and Kishore Nallan offered insights and created new features to help solve the problem, which was then tested and deployed by Daren.
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.
Improving Search Hits in Typesense with User Feedback
Krish asked how to improve search hits based on user input. Kishore Nallan answered Typesense would allow manual curation and informed of upcoming updates.
Resolving Issues with Scoped API Keys in Typesense with Golang
Suvarna had problems with generating and using scoped API keys in Typesense with Golang. Several bugs misleading the user were found and fixed by Kishore Nallan.