From 1dd4b22d20d466ff896ad28bc57e824a9eb10c15 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Thu, 22 Apr 2021 17:08:18 +0200 Subject: wip: skate-dot --- skate/cmd/skate-dot/main.go | 19 ++++++------------- 1 file 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) -- cgit v1.2.3