# Searching Elastic Search with low level client

**URL:** <https://discuss.elastic.co/t/searching-elastic-search-with-low-level-client/187989>\
**Category:** Elasticsearch\
**Created:** [June 28, 2019, 8:06am UTC](https://discuss.elastic.co/t/searching-elastic-search-with-low-level-client/187989 "2019-06-28T08:06:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roma\_sodha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roma_sodha/32/48989_2.png) [@roma\_sodha](https://discuss.elastic.co/u/roma_sodha)\
**Post date:** [June 28, 2019, 8:06am UTC](https://discuss.elastic.co/t/searching-elastic-search-with-low-level-client/187989/1 "2019-06-28T08:06:40Z")

</div>

Hi All,

I have just started with elastic search.  
I am searching elasticsearch database, with low-level [[Elasticsearch.Net](http://Elasticsearch.Net)]

([https://github.com/elasticsearch/elasticsearch-net/tree/master/src/Elasticsearch.Net](https://github.com/elasticsearch/elasticsearch-net/tree/master/src/Elasticsearch.Net)) client.

I am using source query as lucene queries to extract records from elastic search database.

Here are some of my queries

1. While searching with low level client, does it post anything to elastic search db, as in argument I see postdata as parameter passed?

//.LowLevel is of type IElasticLowLevelClient  
// Generic parameter of Search\<\> is the type of .Body on response  
var response = client.LowLevel.Search\<SearchResponse\>("myindex", PostData.Serializable(new

1. Does using low level queries impact my search results ?  
I want to use lucene's query in body while searching and need to make sure I get upto date response.

I want to use lucene's queries to extract data from elastic search, which is best feasbile option?  
I see we can use NEST powerful DSL, but i have limited knowledge in creating NEST queries.

3.) How to deal with huge response?  
Currently response is stored it in StringResponse and need to handle huge responses as well.  
Stringresponse strResponse= esClient.LowLevel.Search(Of StringResponse)(argin\_strIndex01,argin\_strQuery)

Thanks.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [July 1, 2019, 1:14am UTC](https://discuss.elastic.co/t/searching-elastic-search-with-low-level-client/187989/2 "2019-07-01T01:14:23Z")

</div>

Let me see if I can answer your questions

> [@roma\_sodha](#):
>
> 1. While searching with low level client, does it post anything to Elasticsearch db, as in argument I see postdata as parameter passed?

The .NET client does not send request bodies with HTTP GET requests as they are not supported by the underlying HTTP library used, so whenever a request will send a body using `PostData`, the request will always be a HTTP POST (or a PUT, depending on the operation).

For example, using the low level client exposed on NEST 7.x, the high level client

```auto
var client = new ElasticClient();

var searchResponse = client.LowLevel.Search<StringResponse>(PostData.Serializable(new 
{
    query = new 
    {
        query_string = new 
        {
            default_field = "content",
            // Lucene query
            query = "this AND that OR thus"
        }    
    }
}));

```

results in the following [query string query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)

```json
POST http://localhost:9200/_search
{"query":{"query_string":{"default_field":"content","query":"this AND that OR thus"}}}

```

> [@roma\_sodha](#):
>
> 1. Does using low level queries impact my search results ?  
> I want to use lucene's query in body while searching and need to make sure I get upto date response.

You can use the low level or high level client, it's up to you. The difference between them is that the latter has types for all requests and responses. and documents can be modelled with **P** lain **O** ld **C** LR **O** bjects ( **POCO** s), making it easier to develop with.

> [@roma\_sodha](#):
>
> 1. How to deal with huge response?

You should look at [paginating](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html) or [scrolling](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) responses (and [search\_after](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html), for some scenarios).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 29, 2019, 1:14am UTC](https://discuss.elastic.co/t/searching-elastic-search-with-low-level-client/187989/3 "2019-07-29T01:14:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
