Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
I am using Elastic search for an ASP.NET MVC project. The Elasticsearch.Net client stopped working after a version update from 5.5.0 to 7.7.0. The type component has been removed from the query and there is a change in object serialization. I was trying to fix the query but I cannot be able to succeed.

I have attached the query code below.

Can anyone help me on this?

Thanks in advance.

What I have tried:

string postCode = "SW3";

var response = elasticClient.Search<AddressDom>(s => s.Index("new_address")
                     .Type("uk")              
              .From(0)
              .Take(100)
              .Query(qry => qry
                  .Bool(b => b
                  .Must(m => m
                      .QueryString(qs => qs
                          .DefaultField("Postcode")
                          .Query(postCode + "*").DefaultOperator(Operator.And)))))
                          .Sort(x => x.Field(cc => cc.Field("AreaTypeId").Descending())));
Posted
Updated 25-Jun-20 19:28pm
v2
Comments
Richard MacCutchan 26-Jun-20 3:45am
   
If the problem was caused by an upgrade of a third-party product then you should be asking the people who supply and support it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100