Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900