elasticsearch嵌套的搜索问题-路由错误您请求的路径无效

hvvq6cgz  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(0)|浏览(256)

我正在用nest试用elasticsearch
我已经建立了弹性云并上传了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"
      }
    ]
  }

我正在从我的.NETC应用程序中尝试下面的代码

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

我做错什么了吗

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题