分词测试

finance
杨赟 2 years ago
parent 9b40b9942e
commit 0dd5f0eda3

@ -0,0 +1,30 @@
package setting
import (
"context"
"git.oa00.com/supply-chain/service/client"
)
type opensearch struct {
}
type ArgsOpensearchToken struct {
Analyzer string
Text string
}
type TokenOpensearchItem struct {
Token string `json:"token"`
StartOffset int `json:"startOffset"`
EndOffset int `json:"endOffset"`
Type string `json:"type"`
Position int `json:"position"`
}
// Analyzer @Title 分词测试
func (o *opensearch) Analyzer(ctx context.Context, args ArgsOpensearchToken) (result []TokenOpensearchItem, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return
}
err = xClient.Call(ctx, "Analyzer", args, &result)
return
}

@ -3,4 +3,5 @@ package setting
type Setting struct { type Setting struct {
Rate rate Rate rate
Tag tag Tag tag
Opensearch opensearch
} }

Loading…
Cancel
Save