If you search the same word multiple times, pages show up multiple times.
Closed this issue · 1 comments
lukevers commented
To see what I mean, click this:
http://mesh.lukevers.com:9048/search/for%20for%20for%20for
alexander-bauer commented
I guess we could eliminate this using maps. (There is no direct set
in Go, but the map[string]struct{}
type is optimized for this purpose.) Something like the following could work.
//...
termsa := strings.Split(searchterm, " ")
terms := make(map[string]struct{})
for i := range termsa {
terms[termsa[i]] = struct{}
}
//...
We've used code like this in the past, as in the types Index
, site
, and page
.