packages: phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec, phorum-mo...
glen
glen at pld-linux.org
Wed Apr 14 15:34:42 CEST 2010
Author: glen Date: Wed Apr 14 13:34:42 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- error reporing properly
- add sph_counter table structure from doc
---- Files affected:
packages/phorum-mod-sphinx_search:
phorum-mod-sphinx_search.spec (1.2 -> 1.3) , errors.patch (NONE -> 1.1) (NEW), sph_counter.sql (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec
diff -u packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec:1.2 packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec:1.3
--- packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec:1.2 Wed Apr 14 15:28:39 2010
+++ packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec Wed Apr 14 15:34:36 2010
@@ -5,12 +5,14 @@
Summary: Sphinx Fulltext-Search Module
Name: phorum-mod-%{module}
Version: 1.0.0
-Release: 0.1
+Release: 0.2
License: Apache-like
Group: Applications/WWW
Source0: http://www.phorum.org/phorum5/file.php/download/62/3354/sphinx_search_%{version}.tar.gz
# Source0-md5: fd6bafce5d77c1baf90bf5f5e157bfb8
+Source1: sph_counter.sql
Patch0: paths.patch
+Patch1: errors.patch
URL: http://www.phorum.org/phorum5/read.php?62,136982,138325
BuildRequires: rpm-php-pearprov
BuildRequires: rpmbuild(macros) >= 1.268
@@ -39,8 +41,10 @@
%prep
%setup -qc
mv %{module}/* .
+cp -a %{SOURCE1} .
%{__sed} -i -e 's,\r$,,' *.php *.txt README Changelog
%patch0 -p1
+%patch1 -p1
# php-sphinx
rm sphinxclient.php
@@ -51,7 +55,7 @@
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{moduledir}
-cp -a *.txt *.php $RPM_BUILD_ROOT%{moduledir}
+cp -a *.txt *.php sph_counter.sql $RPM_BUILD_ROOT%{moduledir}
%clean
rm -rf $RPM_BUILD_ROOT
@@ -62,6 +66,7 @@
%dir %{moduledir}
%{moduledir}/*.php
%{moduledir}/info.txt
+%{moduledir}/sph_counter.sql
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -69,6 +74,10 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.3 2010/04/14 13:34:36 glen
+- error reporing properly
+- add sph_counter table structure from doc
+
Revision 1.2 2010/04/14 13:28:39 glen
- md5
================================================================
Index: packages/phorum-mod-sphinx_search/errors.patch
diff -u /dev/null packages/phorum-mod-sphinx_search/errors.patch:1.1
--- /dev/null Wed Apr 14 15:34:42 2010
+++ packages/phorum-mod-sphinx_search/errors.patch Wed Apr 14 15:34:36 2010
@@ -0,0 +1,44 @@
+--- phorum-mod-sphinx_search-1.0.0/sphinx_search.php 2010-04-14 16:28:33.609384236 +0300
++++ phorum-mod-sphinx_search-1.0.0/sphinx_search.php 2010-04-14 16:32:02.824588727 +0300
+@@ -84,6 +84,15 @@
+
+ // do the actual query
+ $results = $sphinx->Query($arrSearch['search'],$index);
++
++ $res = $sphinx->GetLastWarning();
++ if ($res) {
++ error_log("sphinx_search.php: WARNING: $res");
++ }
++ $res = $sphinx->GetLastError();
++ if ($res) {
++ error_log("sphinx_search.php: ERROR: $res");
++ }
+
+ // if no messages were found, then return empty handed.
+ if (! isset($results["matches"])) {
+@@ -104,9 +113,6 @@
+ krsort($found_messages);
+ reset($found_messages);
+
+-// print_r($found_messages);/
+-
+-
+ // prepare the array for building highlighted excerpts
+ $docs=array();
+ foreach($found_messages as $id => $data) {
+@@ -123,7 +129,14 @@
+ // build highlighted excerpts
+ $highlighted = $sphinx->BuildExcerpts($docs,$excerpts_index,$words,$opts);
+
+- print $sphinx->GetLastError();
++ $res = $sphinx->GetLastWarning();
++ if ($res) {
++ error_log("sphinx_search.php: WARNING: $res");
++ }
++ $res = $sphinx->GetLastError();
++ if ($res) {
++ error_log("sphinx_search.php: ERROR: $res");
++ }
+
+ $cnt=0;
+ foreach($found_messages as $id => $content) {
================================================================
Index: packages/phorum-mod-sphinx_search/sph_counter.sql
diff -u /dev/null packages/phorum-mod-sphinx_search/sph_counter.sql:1.1
--- /dev/null Wed Apr 14 15:34:42 2010
+++ packages/phorum-mod-sphinx_search/sph_counter.sql Wed Apr 14 15:34:36 2010
@@ -0,0 +1,6 @@
+CREATE TABLE `sph_counter` (
+ `counter_id` int(11) unsigned NOT NULL default '0',
+ `type` enum('author','message') NOT NULL default 'message',
+ `max_doc_id` int(11) NOT NULL,
+ PRIMARY KEY (`counter_id`,`type`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list