Permalink
Browse files

Tsearch updates to 8.4 - again.

  • Loading branch information...
1 parent b7a0410 commit b9e4a2b1c58160e89bc734f018f54a0bbf29328a @kkszysiu committed Feb 7, 2010
Showing with 13 additions and 13 deletions.
  1. +2 −2 aztk/api/Globber.py
  2. +11 −11 aztk/api/Tags.py
View
@@ -199,8 +199,8 @@ def get_images(self, owner_userid, auth_userid, glob, limit=0, offset=0):
if glob['simple_search_query']:
query_args['ssq'] = self._format_query(glob['simple_search_query'])
sub_ors = [
- "t1.fulltext_index @@ to_tsquery('default',%(ssq)s)",
- "t1.ft_tag_index @@ to_tsquery('default',%(ssq)s)"
+ "t1.fulltext_index @@ to_tsquery('english',%(ssq)s)",
+ "t1.ft_tag_index @@ to_tsquery('english',%(ssq)s)"
]
where.append("(%s)" % ' or '.join(sub_ors))
View
@@ -590,8 +590,8 @@ def get_related_tags(self, owner_userid, auth_userid, glob, limit=0, offset=0):
if glob.has_key("simple_search_query") and glob['simple_search_query']:
query_args['ssq'] = self.app.api.globber._format_query(glob['simple_search_query'])
sub_ors = [
- "t1.fulltext_index @@ to_tsquery('default', %(ssq)s)",
- "t1.ft_tag_index @@ to_tsquery('default', %(ssq)s)"
+ "t1.fulltext_index @@ to_tsquery('english', %(ssq)s)",
+ "t1.ft_tag_index @@ to_tsquery('english', %(ssq)s)"
]
where.append("(%s)" % " OR ".join(sub_ors))
@@ -815,8 +815,8 @@ def get_complete_list_with_relations_public(self, owner_userid, glob, limit, sor
if glob.has_key('simple_search_query') and glob['simple_search_query']:
query_args['ssq'] = self.app.api.globber._format_query(glob['simple_search_query'])
sub_ors = [
- "t2.fulltext_index @@ to_tsquery('default',%(ssq)s)",
- "t2.ft_tag_index @@ to_tsquery('default',%(ssq)s')"
+ "t2.fulltext_index @@ to_tsquery('english',%(ssq)s)",
+ "t2.ft_tag_index @@ to_tsquery('english',%(ssq)s')"
]
extra_where.append("(%s)" % ' or '.join(sub_ors))
@@ -825,7 +825,7 @@ def get_complete_list_with_relations_public(self, owner_userid, glob, limit, sor
count = 1
for tag in glob['tag_union']:
query_args["tag_union%s" % count] = self.app.api.globber._format_query(tag)
- ors.append("t2.ft_tag_index @@ to_tsquery('default', %%(tag_union%s)s)" % count)
+ ors.append("t2.ft_tag_index @@ to_tsquery('english', %%(tag_union%s)s)" % count)
count += 1
if len(ors) > 0:
extra_where.append('('+' or '.join(ors)+')')
@@ -933,8 +933,8 @@ def get_complete_list_with_relations_owner(self, owner_userid, glob, limit, sort
if glob.has_key('simple_search_query') and glob['simple_search_query']:
query_args['ssq'] = self.app.api.globber._format_query(glob['simple_search_query'])
sub_ors = [
- "t2.fulltext_index @@ to_tsquery('default', %(ssq)s)",
- "t2.ft_tag_index @@ to_tsquery('default',%(ssq)s)"
+ "t2.fulltext_index @@ to_tsquery('english', %(ssq)s)",
+ "t2.ft_tag_index @@ to_tsquery('english',%(ssq)s)"
]
extra_where.append("(%s)" % ' or '.join(sub_ors))
@@ -943,7 +943,7 @@ def get_complete_list_with_relations_owner(self, owner_userid, glob, limit, sort
count = 1
for tag in glob['tag_union']:
query_args['tag_union%s' % count] = self.app.api.globber._format_query(tag)
- ors.append("t2.ft_tag_index @@ to_tsquery('default',%%(tag_union%s)s)" % count)
+ ors.append("t2.ft_tag_index @@ to_tsquery('english',%%(tag_union%s)s)" % count)
if len(ors) > 0:
extra_where.append('('+' or '.join(ors)+')')
@@ -1047,8 +1047,8 @@ def get_complete_list_with_relations(self, auth_userid, owner_userid, glob, limi
if glob.has_key('simple_search_query') and glob['simple_search_query']:
query_args['ssq'] = self.app.api.globber._format_query(glob['simple_search_query'])
sub_ors = [
- "t3.fulltext_index @@ to_tsquery('default', %(ssq)s)",
- "t3.ft_tag_index @@ to_tsquery('default', %(ssq)s)"
+ "t3.fulltext_index @@ to_tsquery('english', %(ssq)s)",
+ "t3.ft_tag_index @@ to_tsquery('english', %(ssq)s)"
]
inner_where.append("(%s)" % ' or '.join(sub_ors))
@@ -1057,7 +1057,7 @@ def get_complete_list_with_relations(self, auth_userid, owner_userid, glob, limi
count = 1
for tag in glob['tag_union']:
query_args['tag_union%s' % count] = self.app.api.globber._format_query(tag)
- ors.append("t3.ft_tag_index @@ to_tsquery('default', %%(tag_union%s)s)" % count)
+ ors.append("t3.ft_tag_index @@ to_tsquery('english', %%(tag_union%s)s)" % count)
count += 1
if len(ors) > 0:

0 comments on commit b9e4a2b

Please sign in to comment.