|
|
@ -16,18 +16,17 @@ func TSQueryFromSearch(search string) string { |
|
|
|
clearQuotes := false |
|
|
|
startQuotes := false |
|
|
|
|
|
|
|
if strings.HasPrefix(token, "\"") { |
|
|
|
if len(token) > 1 { |
|
|
|
token = token[1:] |
|
|
|
} |
|
|
|
if strings.HasPrefix(token, "\"") && len(token) > 1 { |
|
|
|
startQuotes = true |
|
|
|
} |
|
|
|
if strings.HasSuffix(token, "\"") { |
|
|
|
token = token[:len(token)-1] |
|
|
|
startQuotes = false |
|
|
|
if !startQuotes { |
|
|
|
clearQuotes = true |
|
|
|
} |
|
|
|
|
|
|
|
startQuotes = false |
|
|
|
} |
|
|
|
|
|
|
|
token := strings.Trim(token, ",.;:()\"") |
|
|
|
if len(token) > 0 { |
|
|
|
if startQuotes { |
|
|
|