From afcda4939eaf960cad1994d14b90c27d2cfd4cae Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Mon, 22 Apr 2019 11:37:43 +0200 Subject: [PATCH] Added support for sphinx-3.1.1 Signed-off-by: Janos SUTO --- etc/Makefile.in | 4 +- etc/sphinx.conf.in | 91 ++++++++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 49 deletions(-) diff --git a/etc/Makefile.in b/etc/Makefile.in index c212f6d7..e05ab252 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -31,8 +31,8 @@ all: install: $(INSTALL) -m 0640 -g $(RUNNING_GROUP) $(srcdir)/piler.conf $(DESTDIR)$(sysconfdir)/piler/piler.conf.dist - sed -e 's%LOCALSTATEDIR%$(localstatedir)%g' $(srcdir)/sphinx.conf.in > sphinx.conf.dist - $(INSTALL) -m 0644 -g $(RUNNING_GROUP) $(srcdir)/sphinx.conf.dist $(DESTDIR)$(sysconfdir)/piler/sphinx.conf.dist + sed -e 's%@LOCALSTATEDIR@%$(localstatedir)%g' $(srcdir)/sphinx.conf.in > sphinx.conf.dist + $(INSTALL) -m 0755 -g $(RUNNING_GROUP) $(srcdir)/sphinx.conf.dist $(DESTDIR)$(sysconfdir)/piler/sphinx.conf.dist $(INSTALL) -m 0644 -g $(RUNNING_GROUP) $(srcdir)/config-site.dist.php $(DESTDIR)$(sysconfdir)/piler/config-site.dist.php $(INSTALL) -m 0644 -g $(RUNNING_GROUP) $(srcdir)/cron.jobs.in $(DESTDIR)$(datarootdir)/piler/piler.cron sed -i -e 's%LOCALSTATEDIR%$(localstatedir)%g' $(DESTDIR)$(datarootdir)/piler/piler.cron diff --git a/etc/sphinx.conf.in b/etc/sphinx.conf.in index 0af92020..8663ee8a 100644 --- a/etc/sphinx.conf.in +++ b/etc/sphinx.conf.in @@ -1,3 +1,12 @@ +#!/usr/bin/php + + # # minimal sphinx configuration suited to piler # @@ -76,126 +85,114 @@ source note : base } -source att : base -{ - - sql_query_pre = SET NAMES utf8mb4 - sql_query = select a.id as aid, m.id as mid, a.name AS aname, a.size, REPLACE(REPLACE(m.`from`, '@', 'X'), '.', 'X') as `from`, REPLACE(REPLACE((select group_concat(rcpt.`to` ORDER BY `to` ASC SEPARATOR ' ') from rcpt where rcpt.id=mid group by rcpt.id), '@', 'X'), '.', 'X') as `to` from attachment a, metadata m where m.piler_id=a.piler_id - - sql_attr_uint = size - sql_attr_uint = mid -} - index main1 { source = main1 - path = LOCALSTATEDIR/piler/sphinx/main1 + path = /piler/sphinx/main1 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F + } index main2 { source = main2 - path = LOCALSTATEDIR/piler/sphinx/main2 + path = /piler/sphinx/main2 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F + } index main3 { source = main3 - path = LOCALSTATEDIR/piler/sphinx/main3 + path = /piler/sphinx/main3 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F + } index main4 { source = main4 - path = LOCALSTATEDIR/piler/sphinx/main4 + path = /piler/sphinx/main4 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F + } index dailydelta1 { source = dailydelta - path = LOCALSTATEDIR/piler/sphinx/dailydelta1 + path = /piler/sphinx/dailydelta1 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F + } index delta1 { source = delta - path = LOCALSTATEDIR/piler/sphinx/delta1 + path = /piler/sphinx/delta1 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F + += 310) { ?> + kbatch = main1, main2, main3, main4, dailydelta1 + } index tag1 { source = tag - path = LOCALSTATEDIR/piler/sphinx/tag1 + path = /piler/sphinx/tag1 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F + } index note1 { source = note - path = LOCALSTATEDIR/piler/sphinx/note1 + path = /piler/sphinx/note1 + docinfo = extern dict = keywords + min_prefix_len = 5 min_word_len = 1 - #ngram_len = 1 - #ngram_chars = U+3000..U+2FA1F -} - - -index att1 -{ - source = att - path = /var/piler/sphinx/att1 - docinfo = extern - dict = keywords - min_prefix_len = 6 - min_word_len = 1 - ngram_len = 1 - ngram_chars = U+1100..U+2FA1F + }