Wildcard query using NEST API

We have the following Wildcard query.
What we want to do is if the query matches the beginning then it should be boosted to the top. All results should be in Ascending alphabetic order based on the field "Name" which is the target of the query for those that begin with the prefix and thoose that have the refix within their name.

var searchResponse = client.Search<Locality>(s => s
                    .Index(index)
                    .Size(100)
                    
                    .Query(ss => ss
                        .Wildcard(c => c
                        .Name("named_query")
                        .Boost(1.1)
                        .Field(p => p.Name)
                        .Value($"*{prefix}*")
                        .CaseInsensitive(true)
                        )
                );

Hi @xef ,

just to clarify: Are you using NEST (7.x) or Elastic.Clients.Elasticsearch (8.x)?

Besides that, could you please clarify your question? It's not clear to me whether you need assistance with the client syntax or general assistance to achieve this specific goal with Elasticsearch in the first place.

Do you, for example, have a equivalent REST JSON request that we can translate to the client syntax?

Thanks for responding.
As outlined, we would like to create a query such as the one mentioned using a wildcard and returning the ones that start with the query first and then the rest that do not start with the query but have the qery within.

We are using NEST 7.

It is not just the syntax but also the actual query itself. How it should be formed and sorted in order to achieve the desired result.
Thanks