This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"os" | |
) | |
// structureInfo holds information about JSON structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"os" | |
"sort" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module example.com/es6 | |
go 1.13 | |
require ( | |
github.com/mailru/easyjson v0.7.0 // indirect | |
github.com/olivere/elastic v6.2.27+incompatible | |
github.com/pkg/errors v0.9.1 // indirect | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2012-present Oliver Eilhard. All rights reserved. | |
// Use of this source code is governed by a MIT-license. | |
// See http://olivere.mit-license.org/license.txt for details. | |
// Connect creates an index with a mapping with different data types. | |
// | |
// Example | |
// | |
// mapping -url=http://127.0.0.1:9200 -index=twitter | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2012-present Oliver Eilhard. All rights reserved. | |
// Use of this source code is governed by a MIT-license. | |
// See http://olivere.mit-license.org/license.txt for details. | |
// Illustrates sorting aggs and hits. | |
// | |
// Example | |
// | |
// go run main.go -url=http://127.0.0.1:9200 -index=issue-907 -sniff=false -d | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2012-present Oliver Eilhard. All rights reserved. | |
// Use of this source code is governed by a MIT-license. | |
// See http://olivere.mit-license.org/license.txt for details. | |
// Example code for #907. | |
// | |
// ./issue-907 -url=http://127.0.0.1:9200 -sniff=false -d | |
// | |
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2012-present Oliver Eilhard. All rights reserved. | |
// Use of this source code is governed by a MIT-license. | |
// See http://olivere.mit-license.org/license.txt for details. | |
// Connect simply connects to Elasticsearch. | |
// | |
// Example | |
// | |
// | |
// connect -url=http://127.0.0.1:9200 -sniff=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"log" | |
"github.com/olivere/elastic" | |
) | |
const ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
_ "log" | |
"strings" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"reflect" | |
) | |
type Article struct { | |
Title string `json:"title"` |
NewerOlder