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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
x filter requests by method and endpoint
x parse query parameters (typed)
x re-serialize query parameters into upstream request URL
x method/body for denied requests
- create full request objects in tests
- bad request tests (parse error, disabled query types, etc)
- "completeness" over all the below query types and parameters
- real fatcat+scholar request tests
- minimize tokio feature flags
- see what other requests the default python and javascript client libraries use
- put ProxyConfig in Box? less cloning?
- config: TOML, env, args
=> separate parse schema from options schema
=> example file
- refactor unwrap() into error handling
- package/release
=> generate .deb file
=> Makefile
=> manpage
=> example config?
=> README
=> push git repo
- test in with https://search.qa.fatcat.wiki and observable (javascript)
parse method+path (index) -> which validation method
method+path+params+body -> status, upstream request
## general endpoints
- ping
(?)
- basic info
GET /
(?)
- scroll
POST /_search/scroll
- clear scroll
DELETE /_search/scroll
## per-index endpoints
- basic info; mapping
GET /<index>/_mapping
- count
GET /<index>/_count
- get document
GET /<index>/_doc/<_id>
HEAD /<index>/_doc/<_id>
GET /<index>/_source/<_id>
HEAD /<index>/_source/<_id>
- search
GET /<index>/_search
POST /<index>/_search
- mapping
later:
- multi-get (`_mget`)
- multi-search (`_msearch`)
## query types
compound:
- bool
- boosting
- constant_score
filter (query)
boost (float, optional)
fulltext:
- match
<field>
(bare str allowed)
query (str)
- match_phrase
<field>
(bare str allowed)
value (str)
- multi_match
x query_string
- simple_query_string
term-level:
x exists
field (str)
x ids
values (array of str)
x prefix
x range
<field>
gt, gte, lt, lte: str or number
- NOT regex (?)
x term
<field>
value: str or number
x terms
does not support "lookup" from other indices
<field>
(array of str or number)
x wildcard
<field>
value (str)
boost (float, optional)
rewrite (str, optional)
x match_all
boost (float, optional)
x match_none
boost (float, optional)
TODO:
- terms_set
- span queries
- fuzzy (configurable)
## additional stuff
- headers
- HTTP content-encoding: gzip
- content-type header; always JSON?
- set "Via" header in responses (indicating proxy version/context)
- https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html
- logging
- switch from 'url' to 'percent-encoding' (?)
|