I'm using pg_search in my project and have 'searchable' column:
class AddSearchableColumnToEntities < ActiveRecord::Migration[7.0]
def up
execute <<-SQL
ALTER TABLE entities
ADD COLUMN searchable tsvector GENERATED ALWAYS AS (
setweight(to_tsvector('english', coalesce(title, '')), 'A') ||
setweight(to_tsvector('english', coalesce(source_page_description,'')), 'B')
) STORED;
SQL
end
def down
remove_column :entities, :searchable
end
end
Is it possible to create indexes if I'm expecting title and source_page_description being written in other languages, not only in English?
Hi,
I'm using pg_search in my project and have 'searchable' column:
Is it possible to create indexes if I'm expecting
title
andsource_page_description
being written in other languages, not only in English?I also have search scope like this:
I was looking for examples how I can achieve it with pg_search, but only found how to do it with English language.
Is it supported to have multi-language indexes on same model?
Many thanks!