0

我想手动将对象序列化为字符串并使用 PlainElastic.net 对其进行索引。我尝试了以下:

Disk myDisk = Disks[1]; // Gets a Disk object from a dictionary

string command = Commands.Index("Album", "Music", myDisk.Id.ToString());
string json = "\"query\":{\"disk\": {\"album_id\":\"" + myDisk.albumId + "\",\"disk_id\":\"" + myDisk.Id + "\"}}";
OperationResult response = connection.Put(command, json);

但是,我得到一个例外:

“远程服务器返回错误:(400)错误请求。” 之后,我得到以下异常: {"error":"MapperParsingException[Malformed content, must start with an object]","status":400}

有谁知道我应该如何手动执行索引?

先感谢您。

4

0 回答 0