MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / SearchText

Method SearchText

apps/server/internal/vault/vault.go:2061–2084  ·  view source on GitHub ↗
(query string)

Source from the content-addressed store, hash-verified

2059}
2060
2061func (v *Vault) SearchText(query string) ([]TextSearchMatch, error) {
2062 v.mu.RLock()
2063 defer v.mu.RUnlock()
2064 query = strings.TrimSpace(query)
2065 if query == "" {
2066 return []TextSearchMatch{}, nil
2067 }
2068 needle := strings.ToLower(query)
2069 candidates, err := v.textSearchCandidatesLocked()
2070 if err != nil {
2071 return nil, err
2072 }
2073 out := []TextSearchMatch{}
2074 for _, candidate := range candidates {
2075 if !strings.Contains(candidate.lineLower, needle) {
2076 continue
2077 }
2078 out = append(out, candidate.match)
2079 if len(out) >= 200 {
2080 break
2081 }
2082 }
2083 return out, nil
2084}
2085
2086// --- Assets upload + raw serving ---
2087

Callers 2

searchTextMethod · 0.80

Calls 2

appendFunction · 0.85