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
{ | |
"_id" : ObjectId("5063114bd386d8fadbd6b004"), | |
"name" : "Brian D. Goodman", | |
"organizations" : ["MongoDB"], | |
"locations" : [ | |
{ "type" : "work", | |
"address" : "229 W 34 St., 5th floor", | |
"city" : "New York", | |
"state" : "NY", | |
"zipcode" : "10036" |
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
{ "_id" : ObjectId("5063114bd386d8fadbd6b004"), | |
"name" : "Brian D. Goodman", | |
"organizations" : ["MongoDB”], | |
"locations" : [ | |
{ "type" : "work", | |
"address" : "229 W 34 St., 5th floor", | |
"city" : "New York", | |
"state" : "NY", | |
"zipcode" : "10036" | |
} |
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
{ | |
"_id" : ObjectId("5063114bd386d8fadbd6b004"), | |
"name" : "Brian D. Goodman", | |
"organizations" : ["MongoDB"], | |
"locations" : [ | |
{ "type" : "work", | |
"address" : "229 W 34 St., 5th floor", | |
"city" : "New York", | |
"state" : "NY", | |
"zipcode" : "10036" |
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
SELECT * | |
FROM Samples."samples.dremio.com"."SF_incidents2016.json" |
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
import pandas as pd | |
import elasticsearch | |
import json | |
es = elasticsearch.Elasticsearch() # Assume Elasticsearch is running on localhost | |
dataset_url = "https://data.cityofnewyork.us/api/views/43nn-pn8j/rows.csv?accessType=DOWNLOAD" | |
df = pd.read_csv(dataset_url, header=0, sep=',', | |
dtype={'PHONE': str, 'INSPECTION DATE': str, 'ZIPCODE': str}) |
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 -s http://localhost:9200/restaurants/inspections/_count | jq '.' | |
{ | |
"count": 410649, | |
"_shards": { | |
"total": 5, | |
"successful": 5, | |
"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
SELECT BORO, COUNT(*) c | |
FROM production.restaurants.inspections | |
GROUP BY BORO | |
ORDER BY c DESC |
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
{ | |
"size": 0, | |
"query": { | |
"match_all": {} | |
}, | |
"aggregations": { | |
"BORO": { | |
"terms": { | |
"field": "BORO", | |
"missing": "NULL_STRING_TAG", |
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
SELECT CUISINE_DESCRIPTION, COUNT(*) c | |
FROM production.restaurants.inspections | |
WHERE contains(VIOLATION_DESCRIPTION:(mice OR vermin)) | |
GROUP BY CUISINE_DESCRIPTION | |
ORDER BY c DESC |
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
{ | |
"size": 0, | |
"query": { | |
"query_string": { | |
"query": "VIOLATION_DESCRIPTION : (mice OR vermin )" | |
} | |
}, | |
"aggregations": { | |
"CUISINE_DESCRIPTION": { | |
"terms": { |
OlderNewer