forked from goodow/realtime-search
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotocol.yaml
More file actions
107 lines (101 loc) · 2.18 KB
/
Copy pathprotocol.yaml
File metadata and controls
107 lines (101 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# address: realtime.search
# Define anchors to be referenced below
---
key: &key
_index: twitter
_type: tweet
_id: "1"
keyAndVersion: &keyAndVersion
<<: *key
_version: 1
shards: &shards
total: 5
successful: 5
failed: 0
hits: &hits
total: 2
max_score: 0.19178301
hits:
- <<: *key
_score: 0.19178301
_source: {}
...
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html
---
action: index
<<: *key
version: 1
version_type: external
op_type: create
source:
user: larry
message: hello
--- # reply
<<: *keyAndVersion
created: true
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html
---
action: get
<<: *key
--- # reply
<<: *keyAndVersion
found: true
_source:
user: larry
message: hello
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html
---
action: search
_index: twitter # optional
_indices: [twitter] # optional
_type: tweet # optional
_types: [tweet] # optional
search_type: query_then_fetch # optional
scroll: 5m # This is only required when search_type is scan
source:
from: 0
size: 10
query: {}
filter: {}
facets: {}
sort: # http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html
- user
- {post_date: desc}
--- # reply
took: 2
timed_out: false
_shards: *shards
hits: *hits
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html
---
action: scroll
scroll_id: cXVlcnlUaGV
scroll: 5m
--- # reply
_scroll_id: m9kSGc7Mzk
took: 2
timed_out: false
_shards: *shards
hits: *hits
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html
---
action: putIndexTemplate
_name: template_name
create: false
source:
template: "*"
order: 0
settings:
number_of_shards: 3
number_of_replicas: 1
analysis:
analyzer:
default:
type: ik
use_smart: false
mappings: {}
aliases: {}
--- # reply
acknowledged: true