MCPcopy Create free account
hub / github.com/bytebase/bytebase / getTSQuery

Function getTSQuery

backend/store/issue.go:526–544  ·  view source on GitHub ↗
(text string)

Source from the content-addressed store, hash-verified

524}
525
526func getTSQuery(text string) string {
527 seg := getSegmenter()
528 parts := seg.Trim(seg.CutSearch(text))
529 // CutSearch returns empty for a single word.
530 if len(parts) == 0 {
531 parts = seg.CutTrim(text)
532 }
533 if len(parts) == 0 {
534 return fmt.Sprintf("%s:*", text)
535 }
536 var tsQuery strings.Builder
537 for i, part := range parts {
538 if i != 0 {
539 _, _ = tsQuery.WriteString("|")
540 }
541 _, _ = fmt.Fprintf(&tsQuery, "%s:*", part)
542 }
543 return tsQuery.String()
544}

Callers 1

ListIssuesMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected