<commit_before>package helpers

import (
	"fmt"
	"github.com/gojp/kana"
	"github.com/mattbaird/elastigo/api"
	"github.com/mattbaird/elastigo/core"
	"log"
	"strings"
)

func Search(query string) (hits [][]byte) {
	api.Domain = "localhost"

	isLatin := kana.IsLatin(query)
	isKana := kana.IsKana(query)

	// convert to hiragana and katakana
	romaji := kana.KanaToRomaji(query)

	// handle different types of input differently:
	matches := []string{}
	if isKana {
		// add boost for exact-matching kana<commit_msg>escape double quotes in search query<commit_after>package helpers

import (
	"fmt"
	"github.com/gojp/kana"
	"github.com/mattbaird/elastigo/api"
	"github.com/mattbaird/elastigo/core"
	"log"
	"strings"
)

func Search(query string) (hits [][]byte) {
	api.Domain = "localhost"
	query = strings.Replace(query, "\"", "\\\"", -1)

	isLatin := kana.IsLatin(query)
	isKana := kana.IsKana(query)

	// convert to hiragana and katakana
	romaji := kana.KanaToRomaji(query)

	// handle different types of input differently:
	matches := []string{}
	if isKana {
		// add boost for exact-matching kana
{'fraction_non_alphanumeric': 0.1461187214611872, 'fraction_numerical': 0.0009132420091324201, 'mean_word_length': 4.194312796208531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1031628', 'n_tokens_mistral': 446, 'n_tokens_neox': 420, 'n_words': 91}