Commit 0d04bdf5 authored by Giuseppe Terrasi's avatar Giuseppe Terrasi

- disable sphinxfulltext modules
- fix pgfulltext module
parent 6944eec2
...@@ -16,11 +16,11 @@ def question_search(self, keywords): ...@@ -16,11 +16,11 @@ def question_search(self, keywords):
tables = ['forum_rootnode_doc'], tables = ['forum_rootnode_doc'],
select={ select={
'ranking': """ 'ranking': """
rank_exact_matches(ts_rank_cd('{0.1, 0.2, 0.8, 1.0}'::float4[], "forum_rootnode_doc"."document", to_tsquery('english', %s), 32)) rank_exact_matches(ts_rank_cd('{0.1, 0.2, 0.8, 1.0}'::float4[], "forum_rootnode_doc"."document", to_tsquery('italian', %s), 32))
""", """,
}, },
where=[""" where=["""
"forum_rootnode_doc"."node_id" = "forum_node"."id" AND ("forum_rootnode_doc"."document" @@ to_tsquery('english', %s) OR "forum_rootnode_doc"."node_id" = "forum_node"."id" AND ("forum_rootnode_doc"."document" @@ to_tsquery('italian', %s) OR
"forum_node"."title" ILIKE %s) "forum_node"."title" ILIKE %s)
"""], """],
params=[tsquery, ilike], params=[tsquery, ilike],
......
...@@ -54,15 +54,15 @@ begin ...@@ -54,15 +54,15 @@ begin
END IF; END IF;
SELECT SELECT
setweight(to_tsvector('english', coalesce(tagnames,'')), 'A') || setweight(to_tsvector('italian', coalesce(tagnames,'')), 'A') ||
setweight(to_tsvector('english', coalesce(title,'')), 'B') || setweight(to_tsvector('italian', coalesce(title,'')), 'B') ||
setweight(to_tsvector('english', coalesce(body,'')), 'C') INTO doc setweight(to_tsvector('italian', coalesce(body,'')), 'C') INTO doc
FROM forum_node WHERE id = root_id; FROM forum_node WHERE id = root_id;
SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%'); SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%');
IF rcount > 0 THEN IF rcount > 0 THEN
FOR cv in SELECT setweight(to_tsvector('english', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%') LOOP FOR cv in SELECT setweight(to_tsvector('italian', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%') LOOP
doc :=(doc || cv); doc :=(doc || cv);
END LOOP; END LOOP;
END IF; END IF;
......
...@@ -46,7 +46,7 @@ SESSION_ENGINE = 'django.contrib.sessions.backends.db' ...@@ -46,7 +46,7 @@ SESSION_ENGINE = 'django.contrib.sessions.backends.db'
# This should be equal to your domain name, plus the web application context. # This should be equal to your domain name, plus the web application context.
# This shouldn't be followed by a trailing slash. # This shouldn't be followed by a trailing slash.
# I.e., http://www.yoursite.com or http://www.hostedsite.com/yourhostapp # I.e., http://www.yoursite.com or http://www.hostedsite.com/yourhostapp
APP_URL = 'http://CHANGE_THIS_PATH' APP_URL = 'http://chiedi.ubuntu-it.org'
#LOCALIZATIONS #LOCALIZATIONS
TIME_ZONE = 'Europe/Rome' TIME_ZONE = 'Europe/Rome'
...@@ -57,7 +57,7 @@ USE_I18N = True ...@@ -57,7 +57,7 @@ USE_I18N = True
LANGUAGE_CODE = 'it' LANGUAGE_CODE = 'it'
DJANGO_VERSION = 1.3 DJANGO_VERSION = 1.3
OSQA_DEFAULT_SKIN = 'default' OSQA_DEFAULT_SKIN = 'light'
# disable mysqlfulltxt and local authentication (registrations users) # disable mysqlfulltxt and local authentication (registrations users)
DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'mysqlfulltext', 'localauth', 'oauthauth', 'facebookauth'] DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'mysqlfulltext', 'localauth', 'oauthauth', 'facebookauth', 'sphinxfulltext']
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