Skip to content

Commit c4b5957

Browse files
committed
Initial import in GitHub
1 parent 35fd751 commit c4b5957

File tree

274 files changed

+18867
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+18867
-0
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# pypi
2+
/build
3+
/dist
4+
5+
# do not wants
6+
*.py[c|o]
7+
*.egg-info
8+
*.egg
9+
.*.swp
10+
11+
# IDEs
12+
.idea
13+
.project

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
elasticsearch-cookbook
2+
======================
3+
4+
PacktPub ElasticSearch CookBook code repository
5+
6+
7+
The code on MacOSX, Linux, FreeBSD and other Unix based systems everything should be installed in a default installation.
8+
9+
For windows users
10+
-----------------
11+
12+
I suggest to install a "Sane shell environment on Windows". Instructions are available on:
13+
http://blog.ruilopes.com/post/2143557964/sane-shell-environment-on-windows
14+
15+
For downloading curl for Windows:
16+
http://www.confusedbycode.com/curl/#downloads
17+
18+
Generally a bash shell and curl must be installed.
19+
20+
These are very common tools in ElasticSearch community.
21+

chapter_03/analyzers/analyzers.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": {
3+
"type": "string",
4+
"index": "analyzed",
5+
"index_analyzer": "standard",
6+
"search_analyzer": "simple"
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"email": {
3+
"properties": {
4+
"sender": {
5+
"type": "string",
6+
"store": "yes",
7+
"index": "not_analyzed"
8+
},
9+
"date": {
10+
"type": "date",
11+
"store": "no",
12+
"index": "not_analyzed"
13+
},
14+
"document": {
15+
"type": "attachment",
16+
"fields": {
17+
"file": {
18+
"store": "yes",
19+
"index": "analyzed"
20+
},
21+
"date": {
22+
"store": "yes"
23+
},
24+
"author": {
25+
"store": "yes"
26+
},
27+
"keywords": {
28+
"store": "yes"
29+
},
30+
"content_type": {
31+
"store": "yes"
32+
},
33+
"title": {
34+
"store": "yes"
35+
}
36+
}
37+
}
38+
}
39+
}
40+
}
41+

chapter_03/child/child_mapping.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"order": {
3+
"properties": {
4+
"id": {
5+
"type": "string",
6+
"store": "yes",
7+
"index": "not_analyzed"
8+
},
9+
"date": {
10+
"type": "date",
11+
"store": "no",
12+
"index": "not_analyzed"
13+
},
14+
"customer_id": {
15+
"type": "string",
16+
"store": "yes",
17+
"index": "not_analyzed"
18+
},
19+
"sent": {
20+
"type": "boolean",
21+
"store": "no",
22+
"index": "not_analyzed"
23+
}
24+
}
25+
},
26+
"item": {
27+
"_parent": {
28+
"type": "order"
29+
},
30+
"type": "nested",
31+
"properties": {
32+
"name": {
33+
"type": "string",
34+
"store": "no",
35+
"index": "analyzed"
36+
},
37+
"quantity": {
38+
"type": "integer",
39+
"store": "no",
40+
"index": "not_analyzed"
41+
},
42+
"vat": {
43+
"type": "double",
44+
"store": "no",
45+
"index": "not_analyzed"
46+
}
47+
}
48+
}
49+
}
50+
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"order": {
3+
"properties": {
4+
"id": {
5+
"type": "string",
6+
"store": "yes",
7+
"index": "not_analyzed"
8+
},
9+
"date": {
10+
"type": "date",
11+
"store": "no",
12+
"index": "not_analyzed"
13+
},
14+
"customer_id": {
15+
"type": "string",
16+
"store": "yes",
17+
"index": "not_analyzed"
18+
},
19+
"customer_ip": {
20+
"type": "ip",
21+
"store": "yes",
22+
"index": "yes"
23+
},
24+
"customer_location": {
25+
"type": "geo_point",
26+
"store": "yes"
27+
},
28+
"sent": {
29+
"type": "boolean",
30+
"store": "no",
31+
"index": "not_analyzed"
32+
}
33+
}
34+
}
35+
}
36+

chapter_03/geopoint/values.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"customer_location": {
3+
"lat": 45.61752,
4+
"lon": 9.08363
5+
},
6+
7+
"customer_location": "45.61752,9.08363",
8+
"customer_location": "u0n7w8qmrfj",
9+
"customer_location": [9.08363, 45.61752]
10+
}
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"order": {
3+
"properties": {
4+
"id": {
5+
"type": "string",
6+
"store": "yes",
7+
"index": "not_analyzed"
8+
},
9+
"date": {
10+
"type": "date",
11+
"store": "no",
12+
"index": "not_analyzed"
13+
},
14+
"customer_id": {
15+
"type": "string",
16+
"store": "yes",
17+
"index": "not_analyzed"
18+
},
19+
"customer_ip": {
20+
"type": "ip",
21+
"store": "yes",
22+
"index": "yes"
23+
},
24+
"customer_location": {
25+
"type": "geo_shape",
26+
"tree": "quadtree",
27+
"precision": "1m"
28+
},
29+
"sent": {
30+
"type": "boolean",
31+
"store": "no",
32+
"index": "not_analyzed"
33+
}
34+
}
35+
}
36+
}
37+

chapter_03/ip/ip_field.json

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"order": {
3+
"properties": {
4+
"id": {
5+
"type": "string",
6+
"store": "yes",
7+
"index": "not_analyzed"
8+
},
9+
"date": {
10+
"type": "date",
11+
"store": "no",
12+
"index": "not_analyzed"
13+
},
14+
"customer_id": {
15+
"type": "string",
16+
"store": "yes",
17+
"index": "not_analyzed"
18+
},
19+
"customer_ip": {
20+
"type": "ip",
21+
"store": "yes",
22+
"index": "yes"
23+
},
24+
"sent": {
25+
"type": "boolean",
26+
"store": "no",
27+
"index": "not_analyzed"
28+
}
29+
}
30+
},
31+
"item": {
32+
"_parent": {
33+
"type": "order"
34+
},
35+
"type": "nested",
36+
"properties": {
37+
"name": {
38+
"type": "multi_field",
39+
"fields": {
40+
"name": {
41+
"type": "string",
42+
"index": "not_analyzed"
43+
},
44+
"tk": {
45+
"type": "string",
46+
"index": "analyzed"
47+
},
48+
"code": {
49+
"type": "string",
50+
"index": "analyzed",
51+
"analyzer": "code_analyzer"
52+
}
53+
}
54+
},
55+
"quantity": {
56+
"type": "integer",
57+
"store": "no",
58+
"index": "not_analyzed"
59+
},
60+
"vat": {
61+
"type": "double",
62+
"store": "no",
63+
"index": "not_analyzed"
64+
}
65+
}
66+
}
67+
}
68+

chapter_03/meta/meta_mapping.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"order": {
3+
"_meta": {
4+
"attr1": ["value1", "value2"],
5+
"attr2": {
6+
"attr3": "value3"
7+
}
8+
}
9+
}
10+
}
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"order": {
3+
"properties": {
4+
"id": {
5+
"type": "string",
6+
"store": "yes",
7+
"index": "not_analyzed"
8+
},
9+
"date": {
10+
"type": "date",
11+
"store": "no",
12+
"index": "not_analyzed"
13+
},
14+
"customer_id": {
15+
"type": "string",
16+
"store": "yes",
17+
"index": "not_analyzed"
18+
},
19+
"sent": {
20+
"type": "boolean",
21+
"store": "no",
22+
"index": "not_analyzed"
23+
}
24+
}
25+
},
26+
"item": {
27+
"_parent": {
28+
"type": "order"
29+
},
30+
"type": "nested",
31+
"properties": {
32+
"name": {
33+
"type": "multi_field",
34+
"fields": {
35+
"name": {
36+
"type": "string",
37+
"index": "not_analyzed"
38+
},
39+
"tk": {
40+
"type": "string",
41+
"index": "analyzed"
42+
},
43+
"code": {
44+
"type": "string",
45+
"index": "analyzed",
46+
"analyzer": "code_analyzer"
47+
}
48+
}
49+
},
50+
"quantity": {
51+
"type": "integer",
52+
"store": "no",
53+
"index": "not_analyzed"
54+
},
55+
"vat": {
56+
"type": "double",
57+
"store": "no",
58+
"index": "not_analyzed"
59+
}
60+
}
61+
}
62+
}
63+

0 commit comments

Comments
 (0)