debug
parent
27ab4fa202
commit
398a9c2772
|
@ -245,7 +245,6 @@ func SearchArticleESHightLight(c *gin.Context) {
|
|||
x := []RetHighlight{}
|
||||
_, e = db.GetElastic().
|
||||
QueryHighlight("doc", query, &x,highlight, 10, 0)
|
||||
log.Print(x)
|
||||
if nil != e {
|
||||
log.Print(e.Error())
|
||||
return
|
||||
|
|
|
@ -86,7 +86,6 @@ func (p *ElkEngine) QueryHighlight(index string, query elastic.Query, v interfac
|
|||
}
|
||||
id := []string{}
|
||||
for _, vs := range res.Hits.Hits {
|
||||
log.Print(vs.Highlight)
|
||||
id = append(id, vs.Id)
|
||||
data, e := vs.Source.MarshalJSON()
|
||||
if nil != e {
|
||||
|
@ -113,7 +112,6 @@ func (p *ElkEngine) QueryHighlight(index string, query elastic.Query, v interfac
|
|||
}
|
||||
id := []string{}
|
||||
for _, vs := range res.Hits.Hits {
|
||||
log.Print(vs.Highlight)
|
||||
id = append(id, vs.Id)
|
||||
data, e := vs.Source.MarshalJSON()
|
||||
// log.Print(string(data))
|
||||
|
|
4
main.go
4
main.go
|
@ -38,7 +38,7 @@ func CORSMiddleware(c *gin.Context) {
|
|||
if config.ApiConfig().RunMode == "release" {
|
||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "https://testingcloud.club")
|
||||
} else {
|
||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://127.0.0.1")
|
||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://127.0.0.1:8080")
|
||||
}
|
||||
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
||||
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
||||
|
@ -50,6 +50,8 @@ func CORSMiddleware(c *gin.Context) {
|
|||
c.Writer.Header().Set("Access-Control-Expose-Headers", "Content-Length")
|
||||
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
|
||||
|
||||
log.Print("remote addr is ",c.Request.RemoteAddr)
|
||||
|
||||
if c.Request.Method == "OPTIONS" {
|
||||
log.Println("OPTIONS")
|
||||
c.AbortWithStatus(200)
|
||||
|
|
Loading…
Reference in New Issue