Skip to content

Commit

Permalink
added use of ai_search_column in temp table
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheppner committed Nov 2, 2024
1 parent 339791c commit 19b849a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/tours.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ const listWrapper = async (req, res) => {

new_search_where_searchterm = ``;
// `AND t.search_column @@ websearch_to_tsquery('${postgresql_language_code}', '${search}') `
new_search_order_searchterm = `ai_search_column <-> (SELECT get_embedding('query: ${search}')) ASC `
new_search_order_searchterm = `ai_search_column <-> (SELECT get_embedding('query: ${search}')) ASC, `
// `COALESCE(ts_rank(COALESCE(t.search_column, ''), COALESCE(websearch_to_tsquery('${postgresql_language_code}', '${search}'), '')), 0) DESC, `
}

Expand Down Expand Up @@ -461,7 +461,8 @@ const listWrapper = async (req, res) => {
t.traverse,
t.quality_rating,
t.month_order,
t.search_column
t.search_column,
t.ai_search_column
FROM city2tour AS c2t
INNER JOIN tour AS t
ON c2t.tour_id=t.id
Expand Down

0 comments on commit 19b849a

Please sign in to comment.