Issue with Dynamic Nested Field Type in TS Collection Schema
TLDR Justin encountered an issue with dynamic nested fields not showing as float
. Jason suggested reproducing the error with a snippet, while Kishore Nallan was tagged for assistance.
1
1
Apr 11, 2023 (6 months ago)
Justin
08:50 PMfloat
instead of an int64
. more details in the thread...Justin
08:50 PMnumericalSpecifications
field, which can contain different keys for different documents (e.g., one document might have an Inside Height
key, while another might have Load Capacity
): 'numericalSpecifications':
{'Inside Height': {'units': 'inch', 'value': 2.25},
'Inside Length': {'units': 'inch', 'value': 11.75},
'Inside Width': {'units': 'inch', 'value': 10.75}
},
i've defined my TS collection schema as follows:
"enable_nested_fields": True,
"fields": [
...
{"name": "numericalSpecifications", "type": "object", "index": True, "facet": True, "optional": True},
{"name": "numericalSpecifications\..*\.units", "type": "string", "optional": True},
{"name": "numericalSpecifications\..*\.value", "type": "float", "facet": True, "optional": True},
i then ingested a collection of documents, and when i retrieve the schema, i see things like this:
{'facet': True,
'index': True,
'infix': False,
'locale': '',
'name': 'numericalSpecifications.Inside Width.value',
'optional': True,
'sort': True,
'type': 'int64'},
Justin
08:51 PM"numericalSpecifications\..*\.value", "type": "float"
, i see dynamic fields like numericalSpecifications.Inside Width.value
assuming type int64
Justin
08:52 PMJustin
08:52 PMApr 12, 2023 (6 months ago)
Jason
05:36 AMJustin
04:56 PMJustin
04:57 PMnumericalSpecifications.foo.value
field looks like an integer, that field will be indexed as an int64
, ignoring the {"name": "numericalSpecifications\\..*\\.value", "type": "float", "facet": true, "optional": true}
schema directiveJustin
04:58 PMOverall Depth
look like an integer. when i retrieve the collection, you can see that they've been indexed with different typesApr 13, 2023 (6 months ago)
Jason
05:30 AMCC: Kishore Nallan
Justin
06:33 AM1
Justin
04:22 PMlet me know if i can elaborate with any further details. thanks!
1
Apr 18, 2023 (5 months ago)
Justin
05:51 PMApr 19, 2023 (5 months ago)
Kishore Nallan
03:18 AMTypesense
Indexed 2779 threads (79% resolved)
Similar Threads
Firestore to Typesense Backfill Issue with Dynamic Paths
Greg experienced issues with Firestore to Typesense backfill not working, and Jason determined it might be related to dynamic paths in Firestore collections not being supported. An RC version of the extension with dynamic path support was considered but needs further review before being shared with Greg.
Defining Nested JSON Schema for Querying
Greg struggled in defining a schema for querying a JSON object with nested fields. Jason offered solutions, with the final resolution involving the use of "object" as a field type for the contributors in the schema.
Troubleshooting Invalid Field Error in Firestore Document Indexing
Darren receives an error when indexing Firestore documents with empty array in "_grades" field. Jason suggests submitting a bug report and manually setting the schema. The user still experiences issues. Kishore Nallan reproduces the bug, but suggests a solution might exist with an explicit 'string[]' type definition. Further investigation is needed.
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.
Troubleshooting 400 Error When Upgrading Typesense Firestore Extension
Orion experienced a `400` error after updating the Typesense Firestore extension, causing issues with cloud functions. They traced the issue back to a data type conflict in their Typesense collection schema after updating. With help from Jason and Kishore Nallan, they resolved the issue by recreating the collection.