Closed dandv closed 3 months ago
Nested documents are supported, SemaDB just serialises any unindexed fields as is. So it shouldn't be a problem to put a nested document.
The questions is, can you index nested fields? To be honest, we didn't have this use case and when implementing I thought we could but never tested it. I would like to say yes, as in "myfield.nestedvector" with dot notation could work but I refrained from adding to the documentation due to lack of tests.
The indexing and select field of queries both use decoder.Query from the message pack library which supports the dot notation for nested fields.
It does work with dot notation myfield.nestedfield
and I added some test cases to cover this. The index schema should now correctly process nested fields; for example if there is a vector inside a nested document following the same notation.
I updated the documentation to give some examples. Hopefully others can follow through.
We'll monitor this and fold into the next beta release. I'll close the issue soonafter.
https://semadb.com/docs/concepts/point/ states
Can a field be an object, i.e. are nested documents supported?