title: Delete documents from elasticsearch in Scala using RestClient
body: <p>I am trying to delete documents from an index whose age(field of the index) is greater than 50. So basically i m trying to write a range query. I have successfully connected to ElasticSearch from Scala and also i am able delete an entire index. But i am not able to write a range query. Can someone please help me to write a range query for deletion of documents from an index in scala. Below is my code snippet to delete an entire index. <strong>I have seen many examples in Java but  I NEED THE SOLUTION IN SCALA.</strong></p>
  
  <pre><code>import com.sksamuel.elastic4s.delete.DeleteByQueryRequest
  import org.apache.http.HttpHost
  import org.apache.http.auth.{AuthScope, Credentials, UsernamePasswordCredentials}
  import org.apache.http.client.CredentialsProvider
  import org.apache.http.impl.client.BasicCredentialsProvider
  import org.apache.http.impl.nio.client.HttpAsyncClientBuilder
  import org.elasticsearch.client.RestClient
  import org.elasticsearch.client.RestClientBuilder
  
  System.setProperty("javax.net.ssl.trustStore", "path of certificate")
  System.setProperty("javax.net.ssl.trustStorePassword", "password")
  
  val  credentials = new UsernamePasswordCredentials("username", "password");
      val credentialsProvider:CredentialsProvider  = new BasicCredentialsProvider
      credentialsProvider.setCredentials(AuthScope.ANY, credentials)
  
  val client = RestClient.builder(new HttpHost("host", 9200,"https")).setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
        override def customizeHttpClient(httpClientBuilder: HttpAsyncClientBuilder): HttpAsyncClientBuilder = httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider)
      }).build
  
  // Delete entire index
  val request = new Request("DELETE", "/products")
  val response = client.performRequest(request)
  </code></pre>