0

我正在尝试使用 Nest 进行弹性搜索

我已经设置了弹性云并上传了 json,所以它现在有 3 个文档。

示例 json 如下

{
    "bookid":123456,
    "bookname":"TEST - Book",
    "team":"TeamA",
    "booksubstatus":"Ready",
    "metagroupname":"AAA Group",
    "metacountry":"Mexico",
    "businessunit":"USA",
    "contact":"Mr Test Tester",
    "lastname":"Tester",
    "itin":[
      {
        "itinId":10000,
        "itindate":"2020-12-01",
        "itintype":"Flight",
        "itinsupplier":"Some supplier",
        "itinlocation":"Some location",
        "itinoperator":"flight",
        "itindetails":"basasa",
        "productname":"My product"
      },
       {
        "itinId":524222,
        "itindate":"2020-12-01",
        "itintype":"Car",
        "itinsupplier":"Some supplier22",
        "itinlocation":"Some location34",
        "itinoperator":"Car ",
        "itindetails":"sdrwerwer",
        "productname":"My product555"
      }
    ]
  }

我正在尝试我的 .net c# 应用程序中的以下代码

var settings = new ConnectionSettings(new Uri("https://e0f09020a8844f1a86kjw873438734hj.ent-search.uksouth.azure.elastic-cloud.com"))
                                .DefaultIndex("documents")
                                .BasicAuthentication("elastic", "xxxxx")
                                .PrettyJson()
                                .ThrowExceptions();
                var client = new ElasticClient(settings);
               // var r = client.Search<StringResponse>(s => s);
                var searchResponse = client.Search<Bookings>(s => s
                   .From(0)
                   .Size(10)

                   .Query(q => q
                        .Match(m => m
                           .Field(f => f.lastname)
                           .Query("Tester")
                        )));

这会产生以下错误

Server Error : Type:  Reason: "Routing Error. The path you have requested is invalid.
Debug Information : Successful (404) low level call on POST: /documents/_search?pretty=true&typed_keys=true

我在这里做错了吗

4

0 回答 0