-
Notifications
You must be signed in to change notification settings - Fork 27
/
sphinx.conf
149 lines (122 loc) · 3.74 KB
/
sphinx.conf
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
source src_auto{
type = pgsql
#####################################################################
## SQL settings (for 'mysql' and 'pgsql' types)
#####################################################################
# some straightforward parameters for SQL source types
sql_host = localhost
sql_user = ershkus
sql_pass = 1
sql_db = postgistemplate
sql_port = 5432
sql_query_range = SELECT MIN(id),MAX(id) FROM ershkus_search_addr
sql_range_step = 1000
# sql_query_pre = SET NAMES UTF8
sql_query = \
SELECT id, full_name as display_name, \
length(full_name) AS length, \
street AS street, \
index_name AS index_name, \
ST_Y(c_geom) as lat, \
ST_X(c_geom) as lon, \
addr_type_id AS addr_type_id, \
CASE addr_type_id \
WHEN 2 THEN region \
WHEN 3 THEN district \
WHEN 4 THEN city \
WHEN 5 THEN village \
WHEN 6 THEN street \
WHEN 7 THEN housenumber \
ELSE '' \
END AS name \
FROM ershkus_search_addr WHERE id >= $start AND id <= $end
# index_name as index,
sql_query_info = SELECT * FROM ershkus_search_addr WHERE id=$id
sql_attr_string = display_name
sql_field_string = index_name
sql_field_string = name
sql_attr_float = lat
sql_attr_float = lon
sql_attr_uint = length
sql_attr_uint = addr_type_id
}
index ershkus_search_auto
{
source = src_auto
path = /var/cache/sphinx/search_prefix
docinfo = extern
morphology = stem_ru
exceptions = /usr/local/etc/sphinx_exceptions
html_strip = 0
charset_type = utf-8
min_word_len = 1
min_prefix_len = 1
enable_star = 1
charset_table = 0..9, A..Z->a..z, _, a..z, U+401->U+415, U+451->U+435, U+410..U+42F->U+430..U+44F, U+430..U+44F
}
source src_addr{
type = pgsql
#####################################################################
## SQL settings (for 'mysql' and 'pgsql' types)
#####################################################################
# some straightforward parameters for SQL source types
# some straightforward parameters for SQL source types
sql_host = localhost
sql_user = ershkus
sql_pass = 1
sql_db = postgistemplate
sql_port = 5432
sql_query_range = SELECT MIN(id),MAX(id) FROM ershkus_search_addr
sql_range_step = 1000
# sql_query_pre = SET NAMES utf8
sql_query = \
SELECT id, index_name as index, full_name as display_name, \
id_link_n as osm_id_n, id_link_w as osm_id_w, id_link_r as osm_id_r, ST_Y(c_geom) as lat, ST_X(c_geom) as lon, \
addr_type_id as addr_type_id, \
region_id as region_id, district_id as district_id, city_id as city_id \
FROM ershkus_search_addr WHERE id >= $start AND id <= $end
# index_name as index,
sql_attr_string = display_name
# sql_attr_string = index_name
sql_attr_string = osm_id_n
sql_attr_string = osm_id_w
sql_attr_string = osm_id_r
sql_attr_float = lat
sql_attr_float = lon
sql_attr_float = addr_type_id
sql_attr_uint = region_id
sql_attr_uint = district_id
sql_attr_uint = city_id
sql_query_info = SELECT * FROM ershkus_search_addr WHERE id=$id
}
index ershkus_search_addr
{
source = src_addr
path = /var/cache/sphinx/search_osm
docinfo = extern
morphology = stem_ru
html_strip = 0
charset_type = utf-8
min_word_len = 1
exceptions = /usr/local/etc/sphinx_exceptions
charset_table = 0..9, A..Z->a..z, _, a..z, U+401->U+415, U+451->U+435, U+410..U+42F->U+430..U+44F, U+430..U+44F
}
indexer
{
mem_limit = 32M
}
searchd
{
listen = 3312
# listen = 9306:mysql41
log = /var/log/searchd.log
query_log = /var/log/query.log
read_timeout = 5
max_children = 30
pid_file = /var/run/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
workers = threads # for RT to work
}