Understanding Document ID Fields and Rectifying Duplicate Document Error
TLDR John queried about understanding document ID fields and fixed a duplication issue with guidance from Jason. They discovered a bug preventing document deletion due to a URL encodable character, with John opening a GitHub issue for it.
1
1
Apr 08, 2022 (21 months ago)
John
12:17 AMNow, I just got a question regarding the id field. I read that if the field is a string and does not contain characters that would require URL encoding, the id field would actually be used to identify a document. Correct?
It just happened that in order to update a document I upserted a document with the same exact id. And it seems like it created a second entry...
How do I know if the id field is actually used as the actual document identifier?
What would you recommend in my case?
Currently running with these versions:
https://cdn.jsdelivr.net/npm/[email protected]/dist/algoliasearch-lite.umd.js
https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.production.min.js
https://cdn.jsdelivr.net/npm/typesense-instantse[email protected]/dist/typesense-instantsearch-adapter.min.js
Jason
12:19 AMThat's correct.
Could you do one or more search(es) that will return these two items? That will include the ID field in the response
John
12:26 AMJason
12:27 AMJohn
12:27 AMJason
12:27 AMJohn
12:28 AMJohn
12:28 AMJason
12:29 AMJohn
12:30 AMJohn
12:39 AMJason
12:40 AMJohn
12:43 AMJason
12:45 AMmulti_search
, then click on the "Preview" for that response, and expand results
, then hits
and then the document
object inside each hitJohn
12:48 AM1
John
12:49 AMJason
12:50 AMJohn
12:54 AMJohn
12:57 AMJason
12:58 AMCorrect.
> Would I see this identifier in each document?
Yup.
> What would its name be?
It will be called
id
and it will be an incrementing numberJohn
12:59 AMJason
12:59 AMid
in the document that will be used as the identifier fieldJohn
12:59 AMJason
01:00 AMCould you post the full JSON of this document you're trying to delete?
John
01:01 AMJohn
01:02 AMJohn
01:03 AMJason
01:03 AMJason
01:04 AMJohn
01:04 AMJohn
01:07 AMJohn
01:07 AMJohn
01:14 AMJason
01:14 AMJason
01:14 AMJohn
01:14 AMJason
01:15 AM<https://xxx-1.a1.typesense.net>
John
01:17 AMBut I guess I need to identify, 'cause the above did not work
Jason
01:18 AMJohn
01:19 AMJohn
01:30 AM{"message": "Could not find a document with id: ART41554-4742%20"}
Jason
03:14 AM1
John
02:51 PMApr 10, 2022 (21 months ago)
John
12:30 AMApr 15, 2022 (21 months ago)
John
11:26 PMFixed in
0.23.0.rc54
Could you let me know where I can find the fix for the issue? Sorry I could not find it...
Jason
11:27 PMJason
11:27 PMJohn
11:27 PMJohn
11:28 PMTypesense
Indexed 3005 threads (79% resolved)
Similar Threads
Cold Start Problem with Dynamic Collections
Adrian reported cold start issues with dynamic collections. Jason suggested using wildcard `*` for query_by parameters, upgrading to `0.25.0.rc34`, and clarified conventions. Adrian's issues were resolved but they reported a limitation that will potentially be addressed.
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.
Issue with Typesense Schema and Ruby Client
Mateo faces issues while creating a schema and using Ruby client for Typesense. Jason suggests using a new field instead of 'id' and provides assistance for Ruby client errors.
Phrase Search Relevancy and Weights Fix
Jan reported an issue with phrase search relevancy using Typesense Instantsearch Adapter. The problem occurred when searching phrases with double quotes. The team identified the issue to be related to weights and implemented a fix, improving the search results.
Fixing Multiple Document Retrieval in Typesense
Phil needed an efficient way to retrieve multiple documents by id. Kishore Nallan proposed a solution available in a pre-release build. After some bug fixing regarding id matching by Jason and Kishore Nallan, Phil successfully tested the solution.