Unable to detect nested object attribute from the resolver results
Closed this issue · 2 comments
Hi,
I had created my zentity model which include some nested object of array attributes to be resolved.
However when I run the resolution, the _attributes list that was return from the result only include those attribute that was declared at the root level of the document.
Those nested object attributes were not being detected thus those nested object array attributes could not be used for subsequent recursive resolving traversal.
Is there anyway to do this? Thanks
E.g
{ "attributes": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "licenseNumber": { "type": "string" } }, "resolvers": { "name": { "attributes": ["lastName", "firstName"] }, "license": { "attributes": ["licenseNumber","firstName"] } }, "matchers": { "exact": { "clause": { "term": { "{{ field }}": "{{ value }}" } } }, "exact_license_nested": { "clause": { "nested": { "path": "license", "query": { "term": { "{{ field }}": "{{ value }}" } } } } }, "fuzzy": { "clause": { "match": { "{{ field }}": { "query": "{{ value }}", "fuzziness": "auto", "operator": "AND" } } } } }, "indices": { "my_index": { "fields": { "firstName": { "attribute": "firstName", "matcher": "fuzzy" }, "lastName": { "attribute": "lastName", "matcher": "fuzzy" }, "license.number.keyword": { "attribute": "licenseNumber", "matcher": "exact_license_nested" } } } } }
When I run the resolution, the result _attributes portion will only consist of
firstName, lastName but not licenseNumber although license.number is inside the document in the form of
license:[{number:1},{number:2}].
Having this will only result in traversing the "name" resolver but not the "license" resolver for subsequent hops.
@kokqing Thanks for pointing this out. I'm able to reproduce the issue, and I'll work toward a resolution in an upcoming patch release.
Closing issue and tracking progress on #85