diff options
Diffstat (limited to 'skate/cmd')
-rw-r--r-- | skate/cmd/skate-dot/main.go | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/skate/cmd/skate-dot/main.go b/skate/cmd/skate-dot/main.go index 97b70ad..3ef99d5 100644 --- a/skate/cmd/skate-dot/main.go +++ b/skate/cmd/skate-dot/main.go @@ -1,4 +1,5 @@ -// skate-dot generates dot files from inbound and outbound citation links. +// skate-dot generates dot files from inbound and outbound citation links. Just +// a demo, replacement for a couple python scripts. package main import ( @@ -22,13 +23,7 @@ var ( func main() { flag.Parse() - // s := "The Determination of Concentration and Type of Ownership on Bank Performance and Risks in Indonesia" - // fmt.Printf("%s\n", wordwrap.WrapString(s, 20)) - cfg := elasticsearch.Config{ - Addresses: []string{ - *es, - }, - } + cfg := elasticsearch.Config{Addresses: []string{*es}} es, err := elasticsearch.NewClient(cfg) if err != nil { log.Fatal(err) @@ -38,9 +33,7 @@ func main() { Es: es, Index: *index, } - log.Println(client) client.Outbound(*ident) - client.Inbound(*ident) } // A client for fatcat and elasticsearch. @@ -56,9 +49,9 @@ func (c *Client) String() string { } func (c *Client) Inbound(ident string) []string { - resp, err := esapi.Search( - esapi.Search.WithContext(context.Background()), - esapi.Search.WithIndex(c.Index), + resp, err := c.Es.Search( + c.Es.Search.WithContext(context.Background()), + c.Es.Search.WithIndex(c.Index), ) if err != nil { log.Fatal(err) |