-
Notifications
You must be signed in to change notification settings - Fork 3
/
riak-schema
75 lines (69 loc) · 2.25 KB
/
riak-schema
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
{
schema,
[
{version, "2.0"},
{default_field, "msg"},
{default_op, "and"},
{n_val, 3},
{analyzer_factory, {erlang, text_analyzers, whitespace_analyzer_factory}}
],
[
%% Don't parse the field, treat it as a single token.
{field, [
{name, "id"},
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
]},
{field, [
{name, "from"},
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
]},
{field, [
{name, "facility"},
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
]},
{field, [
{name, "hostname"},
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
]},
{field, [
{name, "tag"},
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
]},
{field, [
{name, "program"},
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
]},
{field, [
{name, "severity"},
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
]},
%% Parse the field in preparation for full-text searching.
{field, [
{name, "msg"},
{required, true},
{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
]},
%% Treat the field as a date, which currently uses noop_analyzer_factory.
{field, [
{name, "timestamp"},
{type, date},
{inline, only}
]},
{field, [
{name, "priority"},
{type, integer},
{padding_size, 2}
]},
%% A dynamic field. Anything ending in "_text" will use the standard_analyzer_factory.
{dynamic_field, [
{name, "*_text"},
{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
]},
%% A dynamic field. Catches any remaining fields in the
%% document, and uses the analyzer_factory setting defined
%% above for the schema.
{dynamic_field, [
{name, "*"}
]}
]
}.