<commit_before>package api

import (
  "fmt"
) 

type BaseResponse struct {
	Ok      bool        `json:"ok"`
	Index   string      `json:"_index,omitempty"`
	Type    string      `json:"_type,omitempty"`
	Id      string      `json:"_id,omitempty"`
	Source  interface{} `json:"_source,omitempty"` // depends on the schema you've defined
	Version int         `json:"_version,omitempty"`
	Found   bool        `json:"found,omitempty"`
	Exists  bool        `json:"exists,omitempty"`
}

type Status struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Failed     int `json:"failed"`
}

type Match struct {
	OK           bool         `json:"ok"`
	Matches      []string     `json:"matches"`
	Explaination Explaination `json:"explaination,omitempty"`
}

type Explaination struct {
	Value       float32        `json:"value"`
	Description string         `json:"description"`
	Details     []Explaination `json:"details,omitempty"`
}

func Pretty(pretty bool) string {
	prettyString := ""
	if pretty == true {
		prettyString = "pretty=1"
	}
	return prettyString
}


// http://www.elasticsearch.org/guide/reference/api/search/search-type/

func Scan(scan int) string {
    scanString := ""
    if scan > 0 {
      scanString = fmt.Sprintf("&search_type=scan&size=%v",scan)
    }
    return scanString
}

func Scroll(duration string) string {
    scrollString := ""
    if duration != "" {
        scrollString = "&scroll="+duration
    }
    return scrollString
}<commit_msg>Add created field to BaseResponse<commit_after>package api

import (
	"fmt"
)

type BaseResponse struct {
	Ok      bool        `json:"ok"`
	Created bool        `json:"created"`
	Index   string      `json:"_index,omitempty"`
	Type    string      `json:"_type,omitempty"`
	Id      string      `json:"_id,omitempty"`
	Source  interface{} `json:"_source,omitempty"` // depends on the schema you've defined
	Version int         `json:"_version,omitempty"`
	Found   bool        `json:"found,omitempty"`
	Exists  bool        `json:"exists,omitempty"`
}

type Status struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Failed     int `json:"failed"`
}

type Match struct {
	OK           bool         `json:"ok"`
	Matches      []string     `json:"matches"`
	Explaination Explaination `json:"explaination,omitempty"`
}

type Explaination struct {
	Value       float32        `json:"value"`
	Description string         `json:"description"`
	Details     []Explaination `json:"details,omitempty"`
}

func Pretty(pretty bool) string {
	prettyString := ""
	if pretty == true {
		prettyString = "pretty=1"
	}
	return prettyString
}

// http://www.elasticsearch.org/guide/reference/api/search/search-type/

func Scan(scan int) string {
	scanString := ""
	if scan > 0 {
		scanString = fmt.Sprintf("&search_type=scan&size=%v", scan)
	}
	return scanString
}

func Scroll(duration string) string {
	scrollString := ""
	if duration != "" {
		scrollString = "&scroll=" + duration
	}
	return scrollString
}
{'fraction_non_alphanumeric': 0.1294314381270903, 'fraction_numerical': 0.0026755852842809363, 'mean_word_length': 3.1773743016759775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6569202', 'n_tokens_mistral': 927, 'n_tokens_neox': 904, 'n_words': 227}