json - 无法反序列化 JSON 数组 - ElasticSearch.Net/NEST 7.6.1
问题描述
我正在将一个 Visual Basic 项目从 Elasticsearch.Net 5.3.1 和 NEST 5.3.1 升级到 Elasticsearch.Net 7.6.1 和 NEST 7.6.1。我收到“无法反序列化当前 JSON 数组”错误,代码如下。版本 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)))
我的 IndexFile 组件是:
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
解决方案
我认为问题在于在运行时使用的 bin 目录中存在旧版本库的副本。摆脱了旧库,我不再收到 JSON 错误。现在到新的问题...
推荐阅读
- djaty - 为什么受 ID 计数影响的用户总是显示为零?
- react-native - 如何动态更改标题标题
- python - 从 sift.corpora 导入维基百科
- sql - 如何在 Oracle SQL 中将两个查询合二为一
- google-app-maker - Google App Maker:如何在绑定到计算模型的表上实现分页
- python - Tkinter:在其他图像之上显示图像
- postgresql - 有没有办法在 Debezium Postgres 连接器中启用支持以捕获复合类型列?
- elixir - Elixir:当前没有与给定名称关联的进程
- scala - 如何避免对 Spark 数据帧的嵌套调用 - 这不起作用
- spring - Spring可为空的注释生成未知的枚举常量警告