Cannot deserialize the JSON array - ElasticSearch.Net/NEST 7.6.1

115 Views Asked by At

I am upgrading a visual basic project, from Elasticsearch.Net 5.3.1 and NEST 5.3.1, to Elasticsearch.Net 7.6.1 and NEST 7.6.1. I am getting a "Cannot deserialize the current JSON array" error with code below. What needs to change for version 7.6.1?

            Dim indexName As String = "myindex"
            Dim file_id As Integer = 12345

            Dim queryResult = client.DeleteByQuery(Of IndexFile)(
                                         Function(q) q.Index(indexName).Query(
                                             Function(rq) rq.Term(
                                                 Function(f) f.Id, file_id)))

My IndexFile component is:

Imports Nest
Namespace DTO

    Public Class IndexFile
        Public Property Id As Integer

        Public Property ClientID As Integer
        Public Property ClientName As String
        Public Property Attachment As Attachment
        Public Property FileContent As String
        <Text(Fielddata:=True, Analyzer:="filename_analyzier")>
        Public Property FileName As String
        Public Property Description As String
        Public Property EntryUserName As String
        Public Property EntryUserID As Integer
        Public Property UpdateUserName As String
        Public Property UpdateUserID As Integer
        Public Property TemplateID As Integer

        Public Property HasActivity As Boolean
        Public Property PortalShareFlg As Boolean
        Public Property AttachmentFlg As Boolean
        Public Property EntryDate As Date
        Public Property UpdateDate As Date?
        Public Property LWAOFavoriteFlg As Boolean
        Public Property FileFavoriteUserID As String

        Public Property Extension As String
    End Class
End Namespace
1

There are 1 best solutions below

0
Kent On

I think the problem was there were copies of the older version of the libraries sitting in the bin directories that were being used a run-time. Got rid of the old libraries and I am not getting the JSON error anymore. Now onto new problems ...