bug fix
This commit is contained in:
parent
2f62b12b73
commit
f34f0948f4
|
|
@ -5,20 +5,22 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"myschools.me/suguo/search/exceptionless"
|
||||
)
|
||||
|
||||
func indexAdd(id *uint32, uri, title, description *string) {
|
||||
func indexAdd(id *uint32, uri, requestURI, title, description *string) {
|
||||
r := strings.Split(*uri, ".")
|
||||
idx := &struct {
|
||||
ID uint32
|
||||
Text string
|
||||
Document map[string]interface{}
|
||||
}{
|
||||
ID: *id,
|
||||
Text: fmt.Sprintf("%s %s %s", *uri, *title, *description),
|
||||
Text: fmt.Sprintf("%s %s %s", r[0], *title, *description),
|
||||
Document: map[string]interface{}{
|
||||
"url": *uri,
|
||||
"url": *requestURI,
|
||||
"title": *title,
|
||||
"description": *description,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ func siteAccess(uri *string) error {
|
|||
|
||||
if title != "" {
|
||||
id := uint32(crc32.ChecksumIEEE([]byte(*uri)))
|
||||
r := strings.Split(*uri, ".")
|
||||
go indexAdd(&id, &r[0], &title, &description)
|
||||
go indexAdd(&id, uri, &requestUri, &title, &description)
|
||||
}
|
||||
|
||||
urls := urlAnalysis(resp.Body)
|
||||
|
|
|
|||
Loading…
Reference in New Issue