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
body: Center( | |
// Center is a layout widget. It takes a single child and positions it | |
// in the middle of the parent. | |
child: Column( | |
// Column is also a layout widget. It takes a list of children and | |
// arranges them vertically. By default, it sizes itself to fit its | |
// children horizontally, and tries to be as tall as its parent. | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
// Lets create a big fat mouse icon :) |
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
curl -XPUT "http://localhost:9200/twitter/_mapping" -H 'Content-Type: application/json' -d' | |
{ | |
"properties": { | |
"post_time": { "type": "date" }, | |
"username": { "type": "keyword" }, | |
"message": { "type": "text" } | |
} | |
}' |
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
curl -X POST "localhost:9200/twitter/_doc/?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"user" : "eriky", | |
"post_date" : "2019-12-08T14:12:12", | |
"message" : "Who loves Elasticsearch?" | |
} | |
' |
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
{ | |
"_index" : "twitter", | |
"_type" : "_doc", | |
"_id" : "kZ5G224BweuuP0wE7KiO", | |
"_version" : 1, | |
"result" : "created", | |
"_shards" : { | |
"total" : 2, | |
"successful" : 1, | |
"failed" : 0 |
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
curl -X PUT "localhost:9200/twitter?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"settings" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0 | |
} | |
}' |
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
#!/usr/bin/env bash | |
set -e -x | |
tweets=$(cat <<-END | |
{ "username" : "eriky", "post_date" : "2019-12-08T14:10:12", "message" : "I wrote an article on Elasticsearch" } | |
{ "username" : "elon", "post_date" : "2019-12-08T14:16:12", "message" : "Anyone needs a flight to Mars? I have seats available." } | |
{ "username" : "eriky", "post_date" : "2019-12-08T15:10:12", "message" : "@elon Count me in! I love Mars (and Elasticsearch)" } | |
{ "username" : "kimchy", "post_date" : "2019-12-08T15:30:22", "message" : "@eriky I it too (Elasticsearch, not Mars)" } | |
END | |
) |
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
{ | |
"took" : 0, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 1, | |
"successful" : 1, | |
"skipped" : 0, | |
"failed" : 0 | |
}, | |
"hits" : { |
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
{ | |
"took" : 2, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 1, | |
"successful" : 1, | |
"skipped" : 0, | |
"failed" : 0 | |
}, | |
"hits" : { |
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
curl -X GET "localhost:9200/twitter/_search?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"query" : { | |
"term" : { "username" : "kimchy" } | |
} | |
} | |
' |
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
curl -X GET "localhost:9200/twitter/_search?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"bool": { | |
"filter": [ | |
{ "term": { "username": "eriky" }}, | |
{ "range": { "post_date": { "lte": "2020-01-01" }}} | |
] | |
} | |
} |
OlderNewer