this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

palomar: hashtags as case-insensitive term filter (#603)

authored by

bnewbold and committed by
GitHub
c54b106c 911a9f96

+8 -9
+8 -9
search/parse_query.go
··· 21 21 return r == ' ' && !quoted 22 22 }) 23 23 24 - tags := []string{} 25 - 26 24 keep := make([]string, 0, len(parts)) 27 25 for _, p := range parts { 28 26 p = strings.Trim(p, "\"") 29 27 30 28 if strings.HasPrefix(p, "#") && len(p) > 1 { 31 - tags = append(tags, strings.ToLower(p[1:])) 29 + filters = append(filters, map[string]interface{}{ 30 + "term": map[string]interface{}{ 31 + "tag": map[string]interface{}{ 32 + "value": strings.ToLower(p[1:]), 33 + "case_insensitive": true, 34 + }, 35 + }, 36 + }) 32 37 continue 33 38 } 34 39 if strings.HasPrefix(p, "did:") { ··· 57 62 } 58 63 59 64 keep = append(keep, p) 60 - } 61 - 62 - if len(tags) > 0 { 63 - filters = append(filters, map[string]interface{}{ 64 - "terms": map[string]interface{}{"tag": tags}, 65 - }) 66 65 } 67 66 68 67 out := ""