title: Why escaping backslashes are appear in ElasticSearch Nest Query?
body: <p>I am trying to write a C# method that get the <code>queryString</code> of a controller and converts it into an <strong>ElasticSearch</strong> query, like below:</p>
  <pre><code>public QueryContainerDescriptor&lt;T&gt; Convert&lt;T&gt; (IQueryCollection query) where T: class
  {
      var selector = new QueryContainerDescriptor&lt;T&gt;();
      List&lt;QueryContainer&gt; Must = new List&lt;QueryContainer&gt;();
      foreach(var key in query.keys)
      {
          string value = query[key];
          var match = new MatchQuery { Field = $&quot;{key}.keyword&quot;, Query = value };
          list.Add(match)
      }
      selector.Bool(q =&gt; q.Must(Must.ToArray()));
      return selector;
  }
  </code></pre>
  <p>It works as expected, but if I pass a <code>queryString</code> value with a backslash, like:</p>
  <pre><code>http://localhost:5000/api/indexData?user=ESKA\\USER
  </code></pre>
  <p>It should be converted into this query:</p>
  <pre><code>{ &quot;bool&quot;: { &quot;must&quot;: [ { &quot;match&quot; : { &quot;user.keyword&quot;: &quot;ESKA\\USER&quot; } } ] }
  </code></pre>
  <p>But <strong>ElasticSearch</strong> will return nothing because the value will of the query be: <code>ESKA\\\\USER</code> with 4 backslashes, like:</p>
  <pre><code>{ &quot;bool&quot;: { &quot;must&quot;: [ { &quot;match&quot; : { &quot;user.keyword&quot;: &quot;ESKA\\\\USER&quot; } } ] }
  </code></pre>
  <p>how can I solve this issue?</p>