Resolving TS Issue on Id Field and Search Results
TLDR Mubashirullah had issues getting the 'id' field from their schema, which Kishore Nallan explained was due to it being a special identifier in TS 0.22. They recommended creating a 'searchable_id' field.
2
Dec 20, 2021 (23 months ago)
Mubashirullah
11:57 AMWhat type do you recommend for id? I've read something about it needs to be a string.
Also, I don't seem to be getting as much results. I can't seem to understand why that is.
Kishore Nallan
11:58 AMMubashirullah
11:59 AMMubashirullah
11:59 AMtypesense.exceptions.ObjectNotFound: [Errno 404] Could not find a field named
id
in the schema.Kishore Nallan
11:59 AMKishore Nallan
12:00 PMid
field can only be filtered on and cannot be searched on.Kishore Nallan
12:00 PMid
is a special identifier, and we only store it on disk but not as a searchable string.Kishore Nallan
12:01 PMsearchable_id
as a string
type and use that for regular operations.1
Mubashirullah
12:01 PM1
Typesense
Indexed 2779 threads (79% resolved)
Similar Threads
Difficulty in Searching Schema Returns No Results
Robert cannot search anything in a schema they have defined and populated with data. Kishore Nallan asks for a reproducible example.
Adding ID Field to Index and Schema Retrospectively
Zach asked about adding an ID field in the schema without altering existing documents. Jason suggested creating a new field called `id_search` for this purpose.
Specific Collection Backfill and Schema Config in Firebase Extension
Loic asked Jason about backfilling specific collections with the Firebase Extension and configuring collection schemas. The latter explained current limitations and gave advices about handling attributes for search/filtering, storage, and return.
Issue with Query Hangs Identifying Different Collection Field Names
Kanak experiences query hangs when collection field names differ. Ahmed had an issue adding documents to collections, which was self-resolved. Kishore Nallan resolved Kanak's issue with the updated build.
Updating Collection Schema and Querying Unspecified Fields in Typesense
Stefan asked about updating a collection schema. Kishore Nallan stated it's not currently possible but suggested automatic schema detection in version 0.20. Rishabh sought a workaround and Jason suggested creating a new collection with a new schema and re-indexing the data. Rishabh also asked about defining custom field IDs which Jason confirmed is not possible with Typesense.