Add indexes and sphinx.conf (conf and query stolen from https://github.com/Yuego/django-fias)
This commit is contained in:
41
aore/templates/sphinx/data.conf
Normal file
41
aore/templates/sphinx/data.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
source src_{{index_name}}
|
||||
{
|
||||
type = pgsql
|
||||
sql_host = {{db_host}}
|
||||
sql_user = {{db_user}}
|
||||
sql_pass = {{db_password}}
|
||||
sql_db = {{db_name}}
|
||||
sql_port = {{db_port}}
|
||||
|
||||
sql_query = {{!sql_query}}
|
||||
|
||||
sql_field_string = fullname
|
||||
sql_attr_string = aoid
|
||||
sql_attr_string = aoguid
|
||||
sql_attr_uint = aolevel
|
||||
}
|
||||
|
||||
index index_{{ index_name }}
|
||||
{
|
||||
docinfo = extern
|
||||
morphology = stem_ru
|
||||
min_stemming_len = 2
|
||||
|
||||
stopwords =
|
||||
min_word_len = 2
|
||||
charset_type = utf-8
|
||||
min_prefix_len = 1
|
||||
min_infix_len = 0
|
||||
enable_star = 1
|
||||
|
||||
# strip html by default
|
||||
html_strip = 1
|
||||
|
||||
ignore_chars = @, -
|
||||
charset_table = 0..9, A..Z->a..z, _, a..z, \
|
||||
U+0401->U+0435, U+0451->U+0435, \
|
||||
U+410..U+42F->U+430..U+44F, U+430..U+44F
|
||||
|
||||
source = src_{{index_name}}
|
||||
path = {{sphinx_var_path}}/data/index_{{index_name}}
|
||||
}
|
||||
63
aore/templates/sphinx/sphinx.conf
Normal file
63
aore/templates/sphinx/sphinx.conf
Normal file
@@ -0,0 +1,63 @@
|
||||
indexer
|
||||
{
|
||||
# memory limit, in bytes, kiloytes (16384K) or megabytes (256M)
|
||||
# optional, default is 32M, max is 2047M, recommended is 256M to 1024M
|
||||
mem_limit = 256M
|
||||
|
||||
# maximum IO calls per second (for I/O throttling)
|
||||
# optional, default is 0 (unlimited)
|
||||
#
|
||||
# max_iops = 40
|
||||
|
||||
# maximum IO call size, bytes (for I/O throttling)
|
||||
# optional, default is 0 (unlimited)
|
||||
#
|
||||
max_iosize = 524288
|
||||
}
|
||||
|
||||
searchd
|
||||
{
|
||||
|
||||
listen = 127.0.0.1:9312
|
||||
|
||||
# required by RT-indexes
|
||||
workers = threads
|
||||
|
||||
# log file, searchd run info is logged here
|
||||
# optional, default is 'searchd.log'
|
||||
log = {{sphinx_var_path}}/log/searchd.log
|
||||
|
||||
# query log file, all search queries are logged here
|
||||
# optional, default is empty (do not log queries)
|
||||
query_log = {{sphinx_var_path}}/log/query.log
|
||||
|
||||
# client read timeout, seconds
|
||||
# optional, default is 5
|
||||
read_timeout = 5
|
||||
|
||||
# maximum amount of children to fork (concurrent searches to run)
|
||||
# optional, default is 0 (unlimited)
|
||||
max_children = 30
|
||||
|
||||
# PID file, searchd process ID file name
|
||||
# mandatory
|
||||
pid_file = {{sphinx_var_path}}/run/searchd.pid
|
||||
|
||||
# max amount of matches the daemon ever keeps in RAM, per-index
|
||||
# WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL
|
||||
# default is 1000 (just like Google)
|
||||
max_matches = 1000
|
||||
|
||||
# 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 0 (do not preopen)
|
||||
preopen_indexes = 0
|
||||
|
||||
# whether to unlink .old index copies on succesful rotation.
|
||||
# optional, default is 1 (do unlink)
|
||||
unlink_old = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user