# Cant get Search to work with .NET 9 Client

**URL:** <https://discuss.elastic.co/t/cant-get-search-to-work-with-net-9-client/380688>\
**Category:** Elasticsearch\
**Created:** [August 2, 2025, 9:30am UTC](https://discuss.elastic.co/t/cant-get-search-to-work-with-net-9-client/380688 "2025-08-02T09:30:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![c77m](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/c77m/32/144447_2.png) [@c77m](https://discuss.elastic.co/u/c77m)\
**Post date:** [August 2, 2025, 9:30am UTC](https://discuss.elastic.co/t/cant-get-search-to-work-with-net-9-client/380688/1 "2025-08-02T09:30:57Z")

</div>

Hi, new to Elastic Search so I'm a bit stuck, I have indexed som documents and I can see mappings are created for all properties for my document. (might not be optimal right now but just testing this out right now)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/6/26c98504f16a8d7de2d4123c31f3a9b2a949fa94.png)

So I have indexed 10 test documents and I can see them if I do

`var reponse = _client.Indices.Get(_indexFind);`

or

```auto
var reponse = _client.Search<ElasticSearchFindDto>(s => s
    .Indices(_indexFind)
    .Query(q =>
        q.Bool(b => 
            b.Filter(f => 
                f.MatchAll()
            )
        )
    )
);

```

But if I try to match the search on a field I keep getting 0 hits.

```auto
var reponse2 = _client.Search<ElasticSearchFindDto>(s => s
    .Indices(_indexFind)
    .Query(q =>
        q.Bool(b => 
            b.Filter(f => 
                f.Match(m=> 
                    m.Field("RegNo").Query("RegNo_1"))
            )
        )
    )
);

```

What am I missing, have spent hours on this now and I cant get any of my multiple ways I tried this to return anything.

I have tried multiple solutions but this does look like the most logical criteria, as I want to check if a field has a value and if true return it as part of query.

Appreciate more insight what I am mission or doing wrong, feels like something fundamental. 🙂

---

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [August 3, 2025, 4:03am UTC](https://discuss.elastic.co/t/cant-get-search-to-work-with-net-9-client/380688/2 "2025-08-03T04:03:49Z")

</div>

Hello @c77m

Welcome to the community!!

Could you please share the mapping details on Elastic for the one which you are executing the query :

```auto
 f.Match(m=> 
                    m.Field("RegNo").Query("RegNo_1"))

```

Mapping of field "RegNo" & the document where we have the value "RegNo\_1"

Thanks!!

---

<div class="post-metadata">

**Author:** ![c77m](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/c77m/32/144447_2.png) [@c77m](https://discuss.elastic.co/u/c77m)\
**Post date:** [August 3, 2025, 6:02pm UTC](https://discuss.elastic.co/t/cant-get-search-to-work-with-net-9-client/380688/3 "2025-08-03T18:02:48Z")

</div>

Thanks for the reply, I did figure it out last night.

Reason is in my Document my properties are PascalCase but Elastic for some reason map them as CamelCase.

As soon as I search for regNo all works as expected. Anyway to make Elastic map the properties in PascalCase. Im sort of using Reflection to dynamically build the Query. Made a workaround for now to convert property name to CamelCase so now it seems to work as expected.
