@@ -396,9 +396,9 @@ def _update_profile_in_user_dir_txn(txn):
396396 sql = """
397397 INSERT INTO user_directory_search(user_id, vector)
398398 VALUES (?,
399- setweight(to_tsvector('english ', ?), 'A')
400- || setweight(to_tsvector('english ', ?), 'D')
401- || setweight(to_tsvector('english ', COALESCE(?, '')), 'B')
399+ setweight(to_tsvector('simple ', ?), 'A')
400+ || setweight(to_tsvector('simple ', ?), 'D')
401+ || setweight(to_tsvector('simple ', COALESCE(?, '')), 'B')
402402 ) ON CONFLICT (user_id) DO UPDATE SET vector=EXCLUDED.vector
403403 """
404404 txn .execute (
@@ -418,9 +418,9 @@ def _update_profile_in_user_dir_txn(txn):
418418 sql = """
419419 INSERT INTO user_directory_search(user_id, vector)
420420 VALUES (?,
421- setweight(to_tsvector('english ', ?), 'A')
422- || setweight(to_tsvector('english ', ?), 'D')
423- || setweight(to_tsvector('english ', COALESCE(?, '')), 'B')
421+ setweight(to_tsvector('simple ', ?), 'A')
422+ || setweight(to_tsvector('simple ', ?), 'D')
423+ || setweight(to_tsvector('simple ', COALESCE(?, '')), 'B')
424424 )
425425 """
426426 txn .execute (
@@ -435,9 +435,9 @@ def _update_profile_in_user_dir_txn(txn):
435435 elif new_entry is False :
436436 sql = """
437437 UPDATE user_directory_search
438- SET vector = setweight(to_tsvector('english ', ?), 'A')
439- || setweight(to_tsvector('english ', ?), 'D')
440- || setweight(to_tsvector('english ', COALESCE(?, '')), 'B')
438+ SET vector = setweight(to_tsvector('simple ', ?), 'A')
439+ || setweight(to_tsvector('simple ', ?), 'D')
440+ || setweight(to_tsvector('simple ', COALESCE(?, '')), 'B')
441441 WHERE user_id = ?
442442 """
443443 txn .execute (
@@ -764,7 +764,7 @@ async def search_user_dir(self, user_id, search_term, limit):
764764 INNER JOIN user_directory AS d USING (user_id)
765765 WHERE
766766 %s
767- AND vector @@ to_tsquery('english ', ?)
767+ AND vector @@ to_tsquery('simple ', ?)
768768 ORDER BY
769769 (CASE WHEN d.user_id IS NOT NULL THEN 4.0 ELSE 1.0 END)
770770 * (CASE WHEN display_name IS NOT NULL THEN 1.2 ELSE 1.0 END)
@@ -773,13 +773,13 @@ async def search_user_dir(self, user_id, search_term, limit):
773773 3 * ts_rank_cd(
774774 '{0.1, 0.1, 0.9, 1.0}',
775775 vector,
776- to_tsquery('english ', ?),
776+ to_tsquery('simple ', ?),
777777 8
778778 )
779779 + ts_rank_cd(
780780 '{0.1, 0.1, 0.9, 1.0}',
781781 vector,
782- to_tsquery('english ', ?),
782+ to_tsquery('simple ', ?),
783783 8
784784 )
785785 )
0 commit comments