Commit 9b3066c2 authored by 神楽坂玲奈's avatar 神楽坂玲奈

conf

parent b3de45be
Pipeline #9225 passed with stages
in 39 seconds
FROM manticoresearch/manticore:latest
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends util-linux cron && rm -rf /var/lib/apt/lists/*
&& apt-get update && apt-get install -y --no-install-recommends cron && rm -rf /var/lib/apt/lists/*
COPY ./docker-entrypoint.sh /usr/local/bin/
COPY ./reindex.cron /etc/cron.d/reindex.cron
ENV CHECKING_FILE=threads.spm
COPY ./manticore.conf /etc/manticoresearch/manticore.conf
ENV CHECKING_FILE=threads.spm
RUN crontab /etc/cron.d/reindex.cron
......@@ -82,7 +82,7 @@ _replace_conf_from_env() {
}
_check_index_all() {
if [[ ! -f "/var/lib/manticore/$CHECKING_FILE" ]]; then
if [[ ! -f "$CHECKING_FILE" ]]; then
echo "Indexing all..."
gosu manticore indexer --all
fi
......
#!/bin/sh │·······················································································
cat << EOF
searchd {
binlog_path =
listen = 3312
log = /var/log/manticore/searchd.log
max_packet_size = 128M
pid_file = /var/run/manticore/searchd.pid
query_log_format = sphinxql
query_log = /var/log/manticore/query.log
}
source shared {
type = mysql
sql_host = $sql_host
sql_user = $sql_user
sql_pass = $sql_pass
sql_db = $sql_db
sql_query_pre = SET NAMES utf8
sql_query_pre = CREATE TABLE IF NOT EXISTS sph_counter (counter_id INTEGER PRIMARY KEY NOT NULL, max_doc_id INTEGER NOT NULL)
sql_attr_uint = tid
sql_attr_uint = digest
sql_attr_uint = displayorder
sql_attr_uint = authorid
sql_attr_uint = special
sql_attr_timestamp = lastpost
}
source threads : shared {
sql_query_range = SELECT MIN(tid),MAX(tid) FROM pre_forum_thread
sql_query = SELECT tid AS id,tid,subject,digest,displayorder,authorid,lastpost,special FROM pre_forum_thread \
WHERE tid>=\$start AND tid<=\$end
sql_query_post_index = REPLACE INTO sph_counter set counter_id = 1, max_doc_id = \$maxid
}
source threads_minute : shared
{
sql_query = SELECT tid AS id,tid,subject,digest,displayorder,authorid,lastpost,special FROM pre_forum_thread \
WHERE tid > (SELECT max_doc_id FROM sph_counter WHERE counter_id = 1)
}
source posts: shared {
sql_query_range = SELECT MIN(pid),MAX(pid) FROM pre_forum_post
sql_query = SELECT p.pid AS id, p.tid, p.subject, p.message, t.digest, t.displayorder, t.authorid, t.lastpost, t.special \
FROM pre_forum_post AS p LEFT JOIN pre_forum_thread AS t USING(tid) \
WHERE pid>=\$start AND pid<=\$end
sql_query_post_index = REPLACE INTO sph_counter set counter_id = 2, max_doc_id = \$maxid
}
source posts_minute : shared
{
sql_query = SELECT p.pid AS id, p.tid, p.subject, p.message, t.digest, t.displayorder, t.authorid, t.lastpost, t.special \
FROM pre_forum_post AS p LEFT JOIN pre_forum_thread AS t USING(tid) \
WHERE pid > (SELECT max_doc_id FROM sph_counter WHERE counter_id = 2)
}
index threads {
type = plain
source = threads
path = threads
charset_table = chinese
morphology = icu_chinese
stopwords = zh
}
index threads_minute : threads
{
source = threads_minute
path = threads_minute
}
index posts : threads
{
source = posts
path = posts
}
index posts_minute : threads
{
source = posts_minute
path = posts_minute
}
EOF
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment