Skip to content

Commit

Permalink
Nearly ready for first release - cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
bauerjj committed Aug 5, 2012
1 parent d6262cd commit c128279
Show file tree
Hide file tree
Showing 59 changed files with 2,289 additions and 2,043 deletions.
6 changes: 3 additions & 3 deletions assests/cron.reindex.delta.php.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/*
* Add the following cron job to update delta index every 5 minutes:
*/
// */5 * * * * {path_to_php} {path_to_cron}/cron_reindex_delta.php
// */5 * * * * {path_to_php} {path_to_cron}/cron.reindex.delta.php

define('PATH_TO_SPHINX_INDEXER', '{path_to_indexer}');
define('PATH_TO_SPHINX_CONFIG', '{path_to_config}');
define('SPHINX_INDEX_NAME', '{index_prefix}');

$Command = PATH_TO_SPHINX_INDEXER." --config ".PATH_TO_SPHINX_CONFIG." ".SPHINX_INDEX_NAME."delta --rotate ";
system($Command, $Return);
$Command = PATH_TO_SPHINX_INDEXER." --config ".PATH_TO_SPHINX_CONFIG." ".SPHINX_INDEX_NAME."delta --rotate >> {path_to_cron}sphinx_cron.log 2>&1";
exec($Command);
6 changes: 3 additions & 3 deletions assests/cron.reindex.main.php.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/*
* Add the following cron job to update delta index every 5 minutes:
*/
// */5 * * * * {path_to_php} {path_to_cron}/cron_reindex_delta.php
// */5 * * * * {path_to_php} {path_to_cron}/cron.reindex.delta.php

define('PATH_TO_SPHINX_INDEXER', '{path_to_indexer}');
define('PATH_TO_SPHINX_CONFIG', '{path_to_config}');
define('SPHINX_INDEX_NAME', '{index_prefix}');

$Command = PATH_TO_SPHINX_INDEXER." --config ".PATH_TO_SPHINX_CONFIG." ".SPHINX_INDEX_NAME."main --rotate ";
system($Command, $Return);
$Command = PATH_TO_SPHINX_INDEXER." --config ".PATH_TO_SPHINX_CONFIG." ".SPHINX_INDEX_NAME."main --rotate >> {path_to_cron}sphinx_cron.log 2>&1";
exec($Command);
6 changes: 3 additions & 3 deletions assests/cron.reindex.stats.php.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/*
* Add the following cron job to update delta index every 5 minutes:
*/
// */5 * * * * {path_to_php} {path_to_cron}/cron_reindex_delta.php
// */5 * * * * {path_to_php} {path_to_cron}/cron.reindex.delta.php

define('PATH_TO_SPHINX_INDEXER', '{path_to_indexer}');
define('PATH_TO_SPHINX_CONFIG', '{path_to_config}');
define('SPHINX_INDEX_NAME', '{index_prefix}');

$Command = PATH_TO_SPHINX_INDEXER." --config ".PATH_TO_SPHINX_CONFIG." ".SPHINX_INDEX_NAME."stats --rotate ";
system($Command, $Return);
$Command = PATH_TO_SPHINX_INDEXER." --config ".PATH_TO_SPHINX_CONFIG." ".SPHINX_INDEX_NAME."stats --rotate >> {path_to_cron}sphinx_cron.log 2>&1";
exec($Command);
Binary file removed assests/sphinx-2.0.4-release.tar.gz
Binary file not shown.
Binary file added assests/sphinx-2.0.5-release.tar.gz
Binary file not shown.
50 changes: 44 additions & 6 deletions assests/sphinx.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ source {ss_prefix}main_comment
\
INNER JOIN {db_prefix}Discussion as d ON c.DiscussionID = d.DiscussionID\
INNER JOIN {db_prefix}User as u ON c.InsertUserID = u.UserID\
INNER JOIN {db_prefix}Category as cat ON d.CategoryID = cat.CategoryID\
INNER JOIN {db_prefix}Category as cat ON d.CategoryID = cat.CategoryID\
\
WHERE (c.CommentID +1) <=( SELECT max_doc_id FROM {db_prefix}sph_counter WHERE counter_id=1 )\

Expand All @@ -44,6 +44,8 @@ source {ss_prefix}main_comment
sql_attr_uint = docid
sql_attr_uint = catid

{tag_attr}

sql_attr_timestamp = docdateinserted
sql_attr_uint = CountViews
sql_attr_uint = CountComments
Expand All @@ -70,7 +72,7 @@ source {ss_prefix}delta_comment : {ss_prefix}main_comment
\
INNER JOIN {db_prefix}Discussion as d ON c.DiscussionID = d.DiscussionID\
INNER JOIN {db_prefix}User as u ON c.InsertUserID = u.UserID\
INNER JOIN {db_prefix}Category as cat ON d.CategoryID = cat.CategoryID\
INNER JOIN {db_prefix}Category as cat ON d.CategoryID = cat.CategoryID\
\
WHERE (c.CommentID +1) > (SELECT max_doc_id FROM {db_prefix}sph_counter WHERE counter_id=1)\

Expand Down Expand Up @@ -114,6 +116,8 @@ source {ss_prefix}main_discussion
sql_attr_uint = docid
sql_attr_uint = catid

{tag_attr}

sql_attr_timestamp = docdateinserted
sql_attr_uint = CountViews
sql_attr_uint = CountComments
Expand Down Expand Up @@ -191,31 +195,65 @@ index {ss_prefix}stats
source = {ss_prefix}stats
path = {data_path}{ss_prefix}stats
docinfo = extern
morphology = stem_enru
html_strip = 1


}

index vanilla
{
type = distributed
local = {ss_prefix}main
local = {ss_prefix}delta


#index settings
morphology = {morphology}
dict = {dict}
min_stemming_len = {min_stemming_len}
stopwords = {stopwords} #path to text file if enabled, else empty
wordforms = {wordforms}
min_word_len = {min_word_len}
min_prefix_len = {min_prefix_len}
min_infix_len = {min_infix_len}
enable_star = {enable_star}
ngram_len = {ngram_len}
html_strip = {html_strip}
ondisk_dict = {ondisk_dict}
inplace_enable = {inplace_enable}
expand_keywords = {expand_keywords}
rt_mem_limit = {rt_mem_limit}


}

indexer
{
#indexer settings
mem_limit = {mem_limit}
max_iops = {max_iops}
max_iosize = {max_iosize}
write_buffer = {write_buffer}
max_file_field_buffer = {max_file_field_buffer}
}

searchd
{
port = {searchd_port}
log = {log_path}
query_log = {query_path}
read_timeout = 5
max_children = 30
pid_file = {PID_path}


#settings
read_timeout = {read_timeout}
client_timeout = {client_timeout}
max_children = {max_children}
max_matches = {max_matches}
read_buffer = {read_buffer}
workers = {workers}
thread_stack = {thread_stack}
expansion_limit = {expansion_limit}
prefork_rotation_throttle = {prefork_rotation_throttle}

compat_sphinxql_magics = 0 # the future is now
}
Expand Down
Empty file added assests/word_forms.txt
Empty file.
20 changes: 20 additions & 0 deletions assests/word_freq.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
admin
100
120
pic10
nec
1329195906
cum
vulputate
facer
ullum
sint
epicuri
graeci
the
est
vix
qui
ipsum
pri
and
10 changes: 3 additions & 7 deletions class.searchmodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
if (!defined('APPLICATION'))
exit();
/*
Copyright 2008, 2009 Vanilla Forums Inc.
This file is part of Garden.
Garden is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Garden is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Garden. If not, see <http://www.gnu.org/licenses/>.
Contact Vanilla Forums Inc. at support [at] vanillaforums [dot] com
* This overrides the model that ships with Vanilla. Used to place some hooks so the sphinx search plugin
* can superseede the factory search method
*/

class SearchModel extends Gdn_Model {
Expand Down Expand Up @@ -73,7 +69,7 @@ public function Search($Search, $Offset = 0, $Limit = 20) {

$AllSettings = SphinxFactory::BuildSettings();
$Settings = $AllSettings->GetAllSettings();
if ($Settings['Status']->SearchdRunning && $Settings['Status']->SearchdPortStatus)
if ($Settings['Status']->SearchdRunning)
return FALSE; //sphinx is running...don't use default search
else {
// If there are no searches then return an empty array.
Expand Down
Loading

0 comments on commit c128279

Please sign in to comment.