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
Description of the problem including expected versus actual behavior:
When indexing individual documents using IndexAsync<TDocument> everything is as expected. When using BulkAll<T>, additional properties are being added to the index metadata that have the attribute [JsonIgnore].
Steps to reproduce:
Create a class that includes a property with the [JsonIgnore] attribute from from System.Text.Json.Serialization
Index a single instance using IndexAsync
Index multiple instances using BulkAll and observe the ignored properties now in the index metadata
Expected behavior BulkAll should honor the [JsonIgnore] attribute on a property.
The text was updated successfully, but these errors were encountered:
Please double check you are using the JsonIgnoreAttribute from the System.Text.Json namespace and not the one from e.g. Newtonsoft.Json. They are called the same and during my test right now I made the same mistake because the old using was still in the header of my test project 🙂
Please let me know, if that solved your issue. In my local tests I was not able to reproduce the problem after using the correct attribute.
After reviewing our implementation, I think our issue was something unrelated. We rolled our own AutoMap<T> and the index was created as expected using Client.Indices.CreateAsync<T>. IndexAsync did not update the index metadata "mappings", but BulkAll did with properties our auto map ignored.
Elastic.Clients.Elasticsearch version: 8.13.9
Elasticsearch version: 8.13.0
.NET runtime version: net6.0
Operating system version: win11
Description of the problem including expected versus actual behavior:
When indexing individual documents using
IndexAsync<TDocument>
everything is as expected. When usingBulkAll<T>
, additional properties are being added to the index metadata that have the attribute[JsonIgnore]
.Steps to reproduce:
[JsonIgnore]
attribute from fromSystem.Text.Json.Serialization
IndexAsync
BulkAll
and observe the ignored properties now in the index metadataExpected behavior
BulkAll
should honor the[JsonIgnore]
attribute on a property.The text was updated successfully, but these errors were encountered: