-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[azure-search] Serialization fails due to Cannot map a recusive structure. #15656
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Search
Comments
I'm getting the same issue on a project that I'm working on too. For me, I wasn't aware that I did have child objects. If it helps, here is the dataset that causes me issue: [
{
"id": "2dfa8248-2e67-4686-b157-403ed25f3cd8|a78327f6-cee2-4338-978e-49451b9e5977",
"display_name": "Artist XX - Street Album Release (test) ",
"search_data": "<p>The London Restaurant Festival has revealed the line-up for this year’s edition, which marks the 13th year the event has been held across the city.</p>\n<p>The festival, which hopes to celebrate the best of the capital’s cooking, this year boasts more than 50 happenings — inclu ding tastings and restaurant tours — spread out across the entire of October.</p>Charing Cross Road",
"image_url": "",
"item_codename": "super-event",
"description": "<p>The London Restaurant Festival has revealed the line-up for this year’s edition, which marks the 13th year the event has been held across the city.</p>\n<p>The festival, which hopes to celebrate the best of the capital’s cooking, this year boasts more than 50 happenings — including tastings and restaurant tours — spread out across the entire of October.</p>",
"start_date": "2021-10-12T18:00:00.000Z",
"end_date": "2021-10-12T21:00:00.000Z",
"price": 0,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.5110704,
-0.1284451198
]
},
"location_codename": "charring_cross_road",
"language": "default",
"collection": "branding"
},
{
"id": "2dfa8248-2e67-4686-b157-403ed25f3cd8|a1d36f1c-7c12-45ef-adc9-7bdf2e173ce5",
"display_name": "Artist XX - Street Album Release (test) ",
"search_data": "<p>The London Restaurant Festival has revealed the line-up for this year’s edition, which marks the 13th year the event has been held across the city.</p>\n<p>The festival, which hopes to celebrate the best of the capital’s cooking, this year boasts more than 50 happenings — including tastings and restaurant tours — spread out across the entire of October.</p>St. Pauls",
"image_url": "",
"item_codename": "super-event",
"description": "<p>The London Restaurant Festival has revealed the line-up for this year’s edition, which marks the 13th year the event has been held across the city.</p>\n<p>The festival, which hopes to celebrate the best of the capital’s cooking, this year boasts more than 50 happenings — including tastings and restaurant tours — spread out across the entire of October.</p>",
"start_date": "2021-10-19T18:00:00.000Z",
"end_date": "2021-10-19T21:00:00.000Z",
"price": 0,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.5139649,
-0.095404221
]
},
"location_codename": "st__pauls",
"language": "default",
"collection": "branding"
},
{
"id": "2dfa8248-2e67-4686-b157-403ed25f3cd8|2b7b76f0-0060-4921-92d9-22f99ecb8462",
"display_name": "Artist XX - Street Album Release (test) ",
"search_data": "<p>The London Restaurant Festival has revealed the line-up for this year’s edition, which marks the 13th year the event has been held across the city.</p>\n<p>The festival, which hopes to celebrate the best of the capital’s cooking, this year boasts more than 50 happenings — including tastings and restaurant tours — spread out across the entire of October.</p>Woking",
"image_url": "",
"item_codename": "super-event",
"description": "<p>The London Restaurant Festival has revealed the line-up for this year’s edition, which marks the 13th year the event has been held across the city.</p>\n<p>The festival, which hopes to celebrate the best of the capital’s cooking, this year boasts more than 50 happenings — including tastings and restaurant tours — spread out across the entire of October.</p>",
"start_date": "2021-10-22T18:00:00.000Z",
"end_date": "2021-10-22T21:00:00.000Z",
"price": 0,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.3199013,
-0.5596662
]
},
"location_codename": "woking",
"language": "default",
"collection": "branding"
},
{
"id": "49560bee-2790-43d0-8e48-f36877ed8db2|a78327f6-cee2-4338-978e-49451b9e5977",
"display_name": "Artist Street Party (test) ",
"search_data": "<p>Street PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet Party</p>Charing Cross Road",
"image_url": "",
"item_codename": "super-event",
"description": "<p>Street PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet Party</p>",
"start_date": "2021-10-12T18:00:00.000Z",
"end_date": "2021-10-12T21:00:00.000Z",
"price": 0,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.5110704,
-0.1284451198
]
},
"location_codename": "charring_cross_road",
"language": "default",
"collection": "branding"
},
{
"id": "49560bee-2790-43d0-8e48-f36877ed8db2|a1d36f1c-7c12-45ef-adc9-7bdf2e173ce5",
"display_name": "Artist Street Party (test) ",
"search_data": "<p>Street PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet Party</p>St. Pauls",
"image_url": "",
"item_codename": "super-event",
"description": "<p>Street PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet Party</p>",
"start_date": "2021-10-19T18:00:00.000Z",
"end_date": "2021-10-19T21:00:00.000Z",
"price": 0,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.5139649,
-0.095404221
]
},
"location_codename": "st__pauls",
"language": "default",
"collection": "branding"
},
{
"id": "49560bee-2790-43d0-8e48-f36877ed8db2|2b7b76f0-0060-4921-92d9-22f99ecb8462",
"display_name": "Artist Street Party (test) ",
"search_data": "<p>Street PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet Party</p>Woking",
"image_url": "",
"item_codename": "super-event",
"description": "<p>Street PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet PartyStreet Party</p>",
"start_date": "2021-10-22T18:00:00.000Z",
"end_date": "2021-10-22T21:00:00.000Z",
"price": 0,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.3199013,
-0.5596662
]
},
"location_codename": "woking",
"language": "default",
"collection": "branding"
},
{
"id": "9f2bd3e1-63ee-4c51-a327-2207427adfe4|a78327f6-cee2-4338-978e-49451b9e5977",
"display_name": "Test Event Title",
"search_data": "<p>This is the test event description. Aenean <em>fringilla</em> lacinia massa, vel mattis tellus <em>sollicitudin</em> nec. Donec congue leo ac nunc condimentum venenatis. Proin cursus lectus et feugiat tristique.</p>Charing Cross Road",
"image_url": "",
"item_codename": "super-event",
"description": "<p>This is the test event description. Aenean <em>fringilla</em> lacinia massa, vel mattis tellus <em>sollicitudin</em> nec. Donec congue leo ac nunc condimentum venenatis. Proin cursus lectus et feugiat tristique.</p>",
"start_date": "2021-10-12T18:00:00.000Z",
"end_date": "2021-10-12T21:00:00.000Z",
"price": 5,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.5110704,
-0.1284451198
]
},
"location_codename": "charring_cross_road",
"language": "default",
"collection": "branding"
},
{
"id": "9f2bd3e1-63ee-4c51-a327-2207427adfe4|a1d36f1c-7c12-45ef-adc9-7bdf2e173ce5",
"display_name": "Test Event Title",
"search_data": "<p>This is the test event description. Aenean <em>fringilla</em> lacinia massa, vel mattis tellus <em>sollicitudin</em> nec. Donec congue leo ac nunc condimentum venenatis. Proin cursus lectus et feugiat tristique.</p>St. Pauls",
"image_url": "",
"item_codename": "super-event",
"description": "<p>This is the test event description. Aenean <em>fringilla</em> lacinia massa, vel mattis tellus <em>sollicitudin</em> nec. Donec congue leo ac nunc condimentum venenatis. Proin cursus lectus et feugiat tristique.</p>",
"start_date": "2021-10-19T18:00:00.000Z",
"end_date": "2021-10-19T21:00:00.000Z",
"price": 5,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.5139649,
-0.095404221
]
},
"location_codename": "st__pauls",
"language": "default",
"collection": "branding"
},
{
"id": "9f2bd3e1-63ee-4c51-a327-2207427adfe4|2b7b76f0-0060-4921-92d9-22f99ecb8462",
"display_name": "Test Event Title",
"search_data": "<p>This is the test event description. Aenean <em>fringilla</em> lacinia massa, vel mattis tellus <em>sollicitudin</em> nec. Donec congue leo ac nunc condimentum venenatis. Proin cursus lectus et feugiat tristique.</p>Woking",
"image_url": "",
"item_codename": "super-event",
"description": "<p>This is the test event description. Aenean <em>fringilla</em> lacinia massa, vel mattis tellus <em>sollicitudin</em> nec. Donec congue leo ac nunc condimentum venenatis. Proin cursus lectus et feugiat tristique.</p>",
"start_date": "2021-10-22T18:00:00.000Z",
"end_date": "2021-10-22T21:00:00.000Z",
"price": 5,
"object_type": "event",
"location_coordinates": {
"type": "Point",
"coordinates": [
51.3199013,
-0.5596662
]
},
"location_codename": "woking",
"language": "default",
"collection": "branding"
}
] |
Code fix merged with PR #18542. Will be released on 9th. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Search
Describe the bug
When your search document has an array field and you try to index two documents with the same object inside the array, indexing fails with the following error:
It seems to be caused by the serializer which does not seem to allow using the same object more than once: https://github.com/Azure/azure-sdk-for-js/blob/%40azure/search-documents_11.0.3/sdk/search/search-documents/src/serialization.ts#L37
When you pass multiple documents to
SearchClient.uploadDocuments
it seems that it callsserialize
on the whole array. Then if document 1 and document 2 share the same child object, it fails. A workaround could be to iterate over thedocuments
and callserialize
once per document and not on the array. It would still fail if one document references the same child, but that probably doesn't happen too often.To Reproduce
Expected behavior
I should be able to index multiple document that reference the same child objects. To get around it I have to copy the values over to create unique child objects.
The text was updated successfully, but these errors were encountered: