Search issue with elasticsearch nest - Routing Error. The path you have requested is invalid

827 views Asked by At

I am trying out elasticsearch with nest

I have set up elastic cloud and uploaded json, so it has 3 documents now.

Sample json as below

{
    "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"
      }
    ]
  }

I am trying out below code from my .net c# app

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")
                        )));

This produces below errors

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

Am I doing something wrong here

0

There are 0 answers