You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not able to import/upsert a new document data in a collection with a nested indexed field when optional flag is set to false in the schema
Steps to reproduce
Create a collection with nested fields (object or object[] which has a parent_name.child_name)
The nested field should be set with index=true and optional=false (which are the default values)
Try to create a document and it fails with reason that the specific field is indexed in the schema but the document doesn't have the data for the same (but the data was present) "error":"Field parent_name.child_name has been declared in the schema, but is not found in the document."
This issue is faced on v26.0 version and the same is working fine on previous versions
On the version v26.0, tried changing the optional flag to true with still the index as true (which was not being allowed in the previous versions), then this issue is resolved. But this seems contrary, as with index enabled, the field is being set as optional if we enable the optional flag to true.
Expected Behavior
When a nested field is indexed and optional flag is set to false, it should work as expected.
This is working fine in the version v0.25.2
Actual Behavior
When a nested field is indexed and optional flag is set to false, cannot able to add a document.
This issue is seen in the version v26.0
Metadata
Typesense Version: v26.0
OS: Cloud
The text was updated successfully, but these errors were encountered:
Hi @kishorenc, Thanks for the response. I think, I got the issue now.
When you have declared the object, you have declared as follows,
{"name": "name", "type": "object"},
but when I declared the same for an array object, I declared as follows,
{"facet":false,"index":false,"infix":false,"locale":"","name":"oDS","optional":true,"sort":false,"stem":false,"type":"object[]"}
since the index is false and the optional field type as true, I'm facing this issue.
When we declare the object / object[] types, is the index type has to be set to true (i.e default value)?
The schema, document & error I faced are as follows: Scheme:
"fields":[
{"facet":false,"index":false,"infix":false,"locale":"","name":"oDS","optional":true,"sort":false,"stem":false,"type":"object[]"},{"facet":true,"index":true,"infix":false,"locale":"","name":"oDS.delState","optional":false,"sort":false,"stem":false,"type":"string[]"},{"facet":false,"index":true,"infix":false,"locale":"","name":"oDS.delStateValue","optional":false,"sort":false,"stem":false,"type":"int32[]"}]
Error:
{"code":400,"document":"{"id":"1","oDS":[{"delState":"In Progress","delStateValue":1}]}","error":"Field oDS.delStateValue has been declared in the schema, but is not found in the document.","success":false}
Description
Not able to import/upsert a new document data in a collection with a nested indexed field when optional flag is set to false in the schema
Steps to reproduce
"error":"Field
parent_name.child_name
has been declared in the schema, but is not found in the document."On the version v26.0, tried changing the optional flag to true with still the index as true (which was not being allowed in the previous versions), then this issue is resolved. But this seems contrary, as with index enabled, the field is being set as optional if we enable the optional flag to true.
Expected Behavior
When a nested field is indexed and optional flag is set to false, it should work as expected.
This is working fine in the version v0.25.2
Actual Behavior
When a nested field is indexed and optional flag is set to false, cannot able to add a document.
This issue is seen in the version v26.0
Metadata
Typesense Version: v26.0
OS: Cloud
The text was updated successfully, but these errors were encountered: