/
sphinx.conf.example
151 lines (117 loc) · 4.65 KB
/
sphinx.conf.example
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
150
151
#
# Sphinx configuration file sample
#
#############################################################################
## data source definition
#############################################################################
source magento_fulltext
{
# data source type. mandatory, no default value
# known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc
type = mysql
#####################################################################
## SQL settings (for 'mysql' and 'pgsql' types)
#####################################################################
# some straightforward parameters for SQL source types
sql_host = localhost
sql_user = root
sql_pass =password
sql_db = magento
sql_port = 3306 # optional, default is 3306
# pre-query, executed before the main fetch query
# multi-value, optional, default is empty list of queries
#
sql_query_pre = SET NAMES utf8
# main document fetch query
# mandatory, integer document ID field MUST be the first selected column
sql_query = SELECT product_id, name, name_attributes, category, data_index, sku FROM sphinx_catalogsearch_fulltext
}
#############################################################################
## index definition
#############################################################################
index fulltext {
source = magento_fulltext
path = /path/to/magento/var/data/production.sphinx.index # Feel free to change
morphology = stem_en #, metaphone # You can add metaphone morphology if you want.
min_word_len = 1 # Indexes all words
blend_chars = - # This presumes people won't type a hyphen into the search bar: quite likely
blend_mode = trim_both #
html_strip = 1 # Just in case anyone tries to get clever in the admin panel and use HTML
}
#############################################################################
## indexer settings
#############################################################################
indexer
{
# memory limit, in bytes, kiloytes (16384K) or megabytes (256M)
# optional, default is 128M, max is 2047M, recommended is 256M to 1024M
mem_limit = 1024M
}
#############################################################################
## searchd settings
#############################################################################
searchd
{
# [hostname:]port[:protocol], or /unix/socket/path to listen on
# known protocols are 'sphinx' (SphinxAPI) and 'mysql41' (SphinxQL)
#
# multi-value, multiple listen points are allowed
# optional, defaults are 9312:sphinx and 9306:mysql41, as below
#
listen = 9312
listen = 9306:mysql41
# log file, searchd run info is logged here
# optional, default is 'searchd.log'
log = /var/log/sphinx/searchd.log
# query log file, all search queries are logged here
# optional, default is empty (do not log queries)
query_log = /var/log/sphinx/query.log
# client read timeout, seconds
# optional, default is 5
read_timeout = 10
# request timeout, seconds
# optional, default is 5 minutes
client_timeout = 10
# maximum amount of children to fork (concurrent searches to run)
# optional, default is 0 (unlimited)
max_children = 30
# maximum amount of persistent connections from this master to each agent host
# optional, but necessary if you use agent_persistent. It is reasonable to set the value
# as max_children, or less on the agent's hosts.
persistent_connections_limit = 30
# PID file, searchd process ID file name
# mandatory
pid_file = /var/log/sphinx/searchd.pid
# seamless rotate, prevents rotate stalls if precaching huge datasets
# optional, default is 1
seamless_rotate = 1
# whether to forcibly preopen all indexes on startup
# optional, default is 1 (preopen everything)
preopen_indexes = 1
# whether to unlink .old index copies on succesful rotation.
# optional, default is 1 (do unlink)
unlink_old = 1
# MVA updates pool size
# shared between all instances of searchd, disables attr flushes!
# optional, default size is 1M
mva_updates_pool = 1M
# max allowed network packet size
# limits both query packets from clients, and responses from agents
# optional, default size is 8M
max_packet_size = 8M
# max allowed per-query filter count
# optional, default is 256
max_filters = 256
# max allowed per-filter values count
# optional, default is 4096
max_filter_values = 4096
# max allowed per-batch query count (aka multi-query count)
# optional, default is 32
max_batch_queries = 32
# multi-processing mode (MPM)
# known values are none, fork, prefork, and threads
# threads is required for RT backend to work
# optional, default is threads
workers = threads # for RT to work
}
# --eof--