forked from golang/pkgsite
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
000004_redo_golang_search_config.down.sql
70 lines (46 loc) · 2.29 KB
/
000004_redo_golang_search_config.down.sql
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
-- Copyright 2020 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
DROP TEXT SEARCH CONFIGURATION golang;
CREATE TEXT SEARCH CONFIGURATION golang (
PARSER = pg_catalog."default" );
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR asciiword WITH simple, english_stem;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR word WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR numword WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR email WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR url WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR host WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR sfloat WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR version WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR hword_numpart WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR hword_part WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR hword_asciipart WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR numhword WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR asciihword WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR hword WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR file WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR "float" WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR "int" WITH simple;
ALTER TEXT SEARCH CONFIGURATION golang
ADD MAPPING FOR uint WITH simple;
COMMENT ON TEXT SEARCH CONFIGURATION golang IS
'TEXT SEARCH CONFIGURATION golang is a custom search configuration used when creating tsvector for search. The url_path token type is remove, so that "github.com/foo/[email protected]" is indexed only as the full URL string, and not also"/foo/[email protected]". The asciiword token type is set to a "simple,english_stem" mapping, so that "plural" words will be indexed without stemming. This idea came from the "Morphological and Exact Search" section here: https://asp437.github.io/posts/flexible-fts.html.';
END;