<commit_before>package com.sksamuel.elastic4s

import org.elasticsearch.client.Requests

/** @author <NAME> */
trait DeleteDsl extends QueryDsl {

    def delete = new DeleteExpectsIdOrFrom
    class DeleteExpectsIdOrFrom {
        def from(indexes: String*) = new DeleteByQueryDefinition(indexes: _*)
        def id(id: Any) = new DeleteByIdExpectsFrom(id.toString)
    }

    class DeleteWithIndexExpectsIdOrQuery(from: String) {
    }

    class DeleteByIdExpectsFrom(id: String) {
        def from(from: String) = new DeleteByIdDefinition(id, from)
    }

    class DeleteByIdDefinition(id: String, from: String) {
        val builder = from.split("/").toList match {
            case i :: Nil => Requests.deleteRequest(i).id(id)
            case i :: t :: Nil => Requests.deleteRequest(i).`type`(t).id(id)
            case _ => throw new IllegalArgumentException("from must be in the form index or index/type")
        }
    }

    class DeleteByQueryDefinition(indexes: String*) extends BulkCompatibleRequest {
        val builder = Requests.deleteByQueryRequest(indexes: _*)
        def where(query: String) = {
            val queryStringDef = new StringQueryDefinition(query)
            builder.query(queryStringDef.builder)
            this
        }
        def where(query: QueryDefinition) = {
            builder.query(query.builder)
            this
        }
    }
}<commit_msg>Updated delete dsl for tuple index/types<commit_after>package com.sksamuel.elastic4s

import org.elasticsearch.client.Requests

/** @author <NAME> */
trait DeleteDsl extends QueryDsl {

    def delete = new DeleteExpectsIdOrFrom
    class DeleteExpectsIdOrFrom {
        def from(indexes: String*) = new DeleteByQueryDefinition(indexes: _*)
        def id(id: Any) = new DeleteByIdExpectsFrom(id.toString)
    }

    class DeleteByIdExpectsFrom(id: String) {
        def from(tuple: (String, String)) = new DeleteByIdDefinition(tuple._1, tuple._2, id)
        def from(from: String) = from.split("/").toList match {
            case index :: Nil => new DeleteByIdDefinition(index, null, id)
            case index :: t :: Nil => new DeleteByIdDefinition(index, t, id)
            case _ => throw new IllegalArgumentException("from must be in the form index->type or index/type")
        }
    }

    class DeleteByIdDefinition(index: String, `type`: String, id: String) {
        val builder = Requests.deleteRequest(index).`type`(`type`).id(id)
    }

    class DeleteByQueryDefinition(indexes: String*) extends BulkCompatibleRequest {
        val builder = Requests.deleteByQueryRequest(indexes: _*)
        def where(query: String) = {
            val queryStringDef = new StringQueryDefinition(query)
            builder.query(queryStringDef.builder)
            this
        }
        def where(query: QueryDefinition) = {
            builder.query(query.builder)
            this
        }
    }
}
{'fraction_non_alphanumeric': 0.10213940648723258, 'fraction_numerical': 0.0013802622498274672, 'mean_word_length': 2.7698309492847852, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2555552', 'n_tokens_mistral': 820, 'n_tokens_neox': 810, 'n_words': 196}