alexander-bauer/distru

If you search the same word multiple times, pages show up multiple times.

Closed this issue · 1 comments

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.