Skip to content

Commit 3e3c444

Browse files
author
Bill Bergin
committed
initial commit
0 parents  commit 3e3c444

10 files changed

+8050
-0
lines changed

.gitignore

+225
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
2+
# Created by https://www.gitignore.io/api/vim,python,pycharm
3+
# Edit at https://www.gitignore.io/?templates=vim,python,pycharm
4+
5+
### PyCharm ###
6+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
7+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8+
9+
# User-specific stuff
10+
.idea/**/workspace.xml
11+
.idea/**/tasks.xml
12+
.idea/**/usage.statistics.xml
13+
.idea/**/dictionaries
14+
.idea/**/shelf
15+
16+
# Generated files
17+
.idea/**/contentModel.xml
18+
19+
# Sensitive or high-churn files
20+
.idea/**/dataSources/
21+
.idea/**/dataSources.ids
22+
.idea/**/dataSources.local.xml
23+
.idea/**/sqlDataSources.xml
24+
.idea/**/dynamic.xml
25+
.idea/**/uiDesigner.xml
26+
.idea/**/dbnavigator.xml
27+
28+
# Gradle
29+
.idea/**/gradle.xml
30+
.idea/**/libraries
31+
32+
# Gradle and Maven with auto-import
33+
# When using Gradle or Maven with auto-import, you should exclude module files,
34+
# since they will be recreated, and may cause churn. Uncomment if using
35+
# auto-import.
36+
# .idea/modules.xml
37+
# .idea/*.iml
38+
# .idea/modules
39+
40+
# CMake
41+
cmake-build-*/
42+
43+
# Mongo Explorer plugin
44+
.idea/**/mongoSettings.xml
45+
46+
# File-based project format
47+
*.iws
48+
49+
# IntelliJ
50+
out/
51+
52+
# mpeltonen/sbt-idea plugin
53+
.idea_modules/
54+
55+
# JIRA plugin
56+
atlassian-ide-plugin.xml
57+
58+
# Cursive Clojure plugin
59+
.idea/replstate.xml
60+
61+
# Crashlytics plugin (for Android Studio and IntelliJ)
62+
com_crashlytics_export_strings.xml
63+
crashlytics.properties
64+
crashlytics-build.properties
65+
fabric.properties
66+
67+
# Editor-based Rest Client
68+
.idea/httpRequests
69+
70+
# Android studio 3.1+ serialized cache file
71+
.idea/caches/build_file_checksums.ser
72+
73+
### PyCharm Patch ###
74+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
75+
76+
# *.iml
77+
# modules.xml
78+
# .idea/misc.xml
79+
# *.ipr
80+
81+
# Sonarlint plugin
82+
.idea/sonarlint
83+
84+
### Python ###
85+
# Byte-compiled / optimized / DLL files
86+
__pycache__/
87+
*.py[cod]
88+
*$py.class
89+
90+
# C extensions
91+
*.so
92+
93+
# Distribution / packaging
94+
.Python
95+
build/
96+
develop-eggs/
97+
dist/
98+
downloads/
99+
eggs/
100+
.eggs/
101+
lib/
102+
lib64/
103+
parts/
104+
sdist/
105+
var/
106+
wheels/
107+
pip-wheel-metadata/
108+
share/python-wheels/
109+
*.egg-info/
110+
.installed.cfg
111+
*.egg
112+
MANIFEST
113+
114+
# PyInstaller
115+
# Usually these files are written by a python script from a template
116+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
117+
*.manifest
118+
*.spec
119+
120+
# Installer logs
121+
pip-log.txt
122+
pip-delete-this-directory.txt
123+
124+
# Unit test / coverage reports
125+
htmlcov/
126+
.tox/
127+
.nox/
128+
.coverage
129+
.coverage.*
130+
.cache
131+
nosetests.xml
132+
coverage.xml
133+
*.cover
134+
.hypothesis/
135+
.pytest_cache/
136+
137+
# Translations
138+
*.mo
139+
*.pot
140+
141+
# Django stuff:
142+
*.log
143+
local_settings.py
144+
db.sqlite3
145+
146+
# Flask stuff:
147+
instance/
148+
.webassets-cache
149+
150+
# Scrapy stuff:
151+
.scrapy
152+
153+
# Sphinx documentation
154+
docs/_build/
155+
156+
# PyBuilder
157+
target/
158+
159+
# Jupyter Notebook
160+
.ipynb_checkpoints
161+
162+
# IPython
163+
profile_default/
164+
ipython_config.py
165+
166+
# pyenv
167+
.python-version
168+
169+
# celery beat schedule file
170+
celerybeat-schedule
171+
172+
# SageMath parsed files
173+
*.sage.py
174+
175+
# Environments
176+
.env
177+
.venv
178+
env/
179+
venv/
180+
ENV/
181+
env.bak/
182+
venv.bak/
183+
184+
# Spyder project settings
185+
.spyderproject
186+
.spyproject
187+
188+
# Rope project settings
189+
.ropeproject
190+
191+
# mkdocs documentation
192+
/site
193+
194+
# mypy
195+
.mypy_cache/
196+
.dmypy.json
197+
dmypy.json
198+
199+
# Pyre type checker
200+
.pyre/
201+
202+
### Python Patch ###
203+
.venv/
204+
205+
### Vim ###
206+
# Swap
207+
[._]*.s[a-v][a-z]
208+
[._]*.sw[a-p]
209+
[._]s[a-rt-v][a-z]
210+
[._]ss[a-gi-z]
211+
[._]sw[a-p]
212+
213+
# Session
214+
Session.vim
215+
216+
# Temporary
217+
.netrwhist
218+
*~
219+
# Auto-generated tag files
220+
tags
221+
# Persistent undo
222+
[._]*.un~
223+
224+
# End of https://www.gitignore.io/api/vim,python,pycharm
225+

Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM python:alpine3.9
2+
3+
WORKDIR /var/app
4+
COPY requirements.txt ./
5+
RUN pip install --no-cache-dir -r requirements.txt
6+
COPY . /var/app

README.md

Whitespace-only changes.

data/airports.dat

+7,543
Large diffs are not rendered by default.

docker-compose.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: '2.2'
2+
services:
3+
elasticsearch:
4+
image: elasticsearch:6.6.0
5+
container_name: elasticsearch
6+
environment:
7+
- cluster.name=docker-cluster
8+
- bootstrap.memory_lock=true
9+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
10+
ulimits:
11+
memlock:
12+
soft: -1
13+
hard: -1
14+
volumes:
15+
- esdata1:/usr/share/elasticsearch/data
16+
ports:
17+
- 9200:9200
18+
networks:
19+
- esnet
20+
21+
kibana:
22+
image: kibana:6.6.0
23+
container_name: kibana
24+
environment:
25+
- "ELASTICSEARCH_URL=http://elasticsearch:9200"
26+
ports:
27+
- 5601:5601
28+
networks:
29+
- esnet
30+
depends_on:
31+
- elasticsearch
32+
33+
script:
34+
build: .
35+
container_name: script
36+
stdin_open: true
37+
tty: true
38+
command: sh
39+
environment:
40+
- "ELASTICSEARCH_URL=http://elasticsearch:9200"
41+
volumes:
42+
- "./:/var/app"
43+
networks:
44+
- esnet
45+
depends_on:
46+
- elasticsearch
47+
48+
volumes:
49+
esdata1:
50+
driver: local
51+
52+
networks:
53+
esnet:

requests

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
GET /airport/_search
2+
{
3+
"query": {
4+
"match_all": {}
5+
}
6+
}
7+
8+
GET /_cat/indices?v
9+
GET /_cat/aliases?v
10+
11+
POST /_aliases
12+
{
13+
"actions" : [
14+
{ "add" : { "index" : "airport", "alias" : "alias1" } }
15+
]
16+
}
17+
18+
19+
POST _reindex
20+
{
21+
"source": {
22+
"index": "twitter"
23+
},
24+
"dest": {
25+
"index": "new_twitter"
26+
}
27+
}
28+
29+
DELETE /airport
30+
31+
GET /airport/_mapping/
32+
33+
PUT airport
34+
{
35+
"settings" : {
36+
"number_of_shards" : 1
37+
},
38+
"mappings" : {
39+
"_doc" : {
40+
"properties" : {
41+
"location" : { "type" : "geo_point" }
42+
}
43+
}
44+
}
45+
}
46+
47+
POST /airport/_search
48+
{
49+
"suggest": {
50+
"text" : "tring out Elasticsearch",
51+
"my-suggest-1" : {
52+
"term" : {
53+
"field" : "name"
54+
}
55+
}
56+
}
57+
}
58+
59+
POST /airport/_search
60+
{
61+
"query": {
62+
"prefix": { "name.normalize": "ha" }
63+
}
64+
}
65+
66+
GET /airport/_search
67+
{
68+
"query": {
69+
"bool": {
70+
"must": {
71+
"match_all": {
72+
}
73+
},
74+
"should": [{
75+
"prefix": {
76+
"name.normalize": "ham"
77+
}
78+
}]
79+
}
80+
}
81+
}
82+
83+
84+
GET /airport/_search
85+
{
86+
"query": {
87+
"bool" : {
88+
"must" : {
89+
"match_all" : {}
90+
},
91+
"filter" : {
92+
"geo_distance" : {
93+
"distance" : "200km",
94+
"location" : {
95+
"lat" : 40,
96+
"lon" : -70
97+
}
98+
}
99+
}
100+
}
101+
}
102+
}

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
elasticsearch==6.3.1

0 commit comments

Comments
 (0)