You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
I was just reviewing some of the old commits of Project Search implementation, I found out that the trigger function is both define in the migration file as well as in the model file of project, at first I thought it was needed but I tested removing the trigger function lines from the model/project.rb file. The trigger function of generating tsvector of name and description and storing it in searchable column was still working.
Describe the solution you'd like
By removing the unnecessary lines, from model/project.rb we could able to refactor this code.
# model/project.rbtrigger.before(:insert,:update)do"tsvector_update_trigger( searchable, 'pg_catalog.english', description, name );"end
Describe alternatives you've considered
No response
Additional context
No response
Are you working on this?
Yes
The text was updated successfully, but these errors were encountered:
this video shows that actually we were generating the tsvector of combinination title and description twice, which is unnecessary computation at database end
Waishnav
changed the title
Refactoring in project search implementation
Bug: Refactoring in project search implementation
Mar 21, 2024
Waishnav
changed the title
Bug: Refactoring in project search implementation
Bug: in project search implementation trigger function to generate tsvector is running twice
Mar 21, 2024
Is your feature request related to a problem? Please describe
I was just reviewing some of the old commits of Project Search implementation, I found out that the trigger function is both define in the migration file as well as in the model file of project, at first I thought it was needed but I tested removing the trigger function lines from the
model/project.rb
file. The trigger function of generating tsvector ofname
anddescription
and storing it insearchable
column was still working.Describe the solution you'd like
By removing the unnecessary lines, from
model/project.rb
we could able to refactor this code.Describe alternatives you've considered
No response
Additional context
No response
Are you working on this?
Yes
The text was updated successfully, but these errors were encountered: