Giter VIP home page Giter VIP logo

Comments (9)

okkez avatar okkez commented on June 1, 2024

Could you try this patch?

diff --git a/db/migrate/20170630063657_create_searcher_records.rb b/db/migrate/20170630063657_create_searcher_records.rb
index 4a8ed49..ce47d3b 100644
--- a/db/migrate/20170630063657_create_searcher_records.rb
+++ b/db/migrate/20170630063657_create_searcher_records.rb
@@ -213,7 +213,7 @@ class CreateSearcherRecords < ActiveRecord::Migration
     sql_rest = <<-SQL
     JOIN issues AS i ON (base.customized_id = i.id)
     JOIN custom_fields AS f ON (base.custom_field_id = f.id)
-    JOIN custom_fields_projects AS r ON (base.custom_field_id = r.custom_field_id)
+    JOIN custom_fields_projects AS r ON (base.custom_field_id = r.custom_field_id AND r.project_id = i.project_id)
     SQL
     sql = "#{sql_base} #{sql_rest} WHERE searchable = true;"
     execute(sql)
@@ -225,7 +225,6 @@ class CreateSearcherRecords < ActiveRecord::Migration
     sql_rest = <<-SQL
     JOIN projects AS p ON (base.customized_id = p.id)
     JOIN custom_fields AS f ON (base.custom_field_id = f.id)
-    JOIN custom_fields_projects AS r ON (base.custom_field_id = r.custom_field_id)
     SQL
     sql = "#{sql_base} #{sql_rest} WHERE searchable = true;"
     execute(sql)

from redmine_full_text_search.

iquiw avatar iquiw commented on June 1, 2024

@okkez Thank you for quick reply.

Is the 2nd chunk of the diff correct? I got Unknown column 'r.project_id' in 'field list': error.
Should it be similar to the 1st chunk?

from redmine_full_text_search.

okkez avatar okkez commented on June 1, 2024

How about this?

We don't need to join custom_fields_projects when handle projects' custom_values. But we need project_id here.

diff --git a/db/migrate/20170630063657_create_searcher_records.rb b/db/migrate/20170630063657_create_searcher_records.rb
index 4a8ed49..2a5386f 100644
--- a/db/migrate/20170630063657_create_searcher_records.rb
+++ b/db/migrate/20170630063657_create_searcher_records.rb
@@ -213,19 +213,18 @@ class CreateSearcherRecords < ActiveRecord::Migration
     sql_rest = <<-SQL
     JOIN issues AS i ON (base.customized_id = i.id)
     JOIN custom_fields AS f ON (base.custom_field_id = f.id)
-    JOIN custom_fields_projects AS r ON (base.custom_field_id = r.custom_field_id)
+    JOIN custom_fields_projects AS r ON (base.custom_field_id = r.custom_field_id AND r.project_id = i.project_id)
     SQL
     sql = "#{sql_base} #{sql_rest} WHERE searchable = true;"
     execute(sql)
 
     sql_base = <<-SQL
     INSERT INTO searcher_records(original_id, original_type, project_id, original_created_on, original_updated_on, #{columns.join(", ")})
-    SELECT base.id, '#{table.classify}', r.project_id, #{transform(original_columns)} FROM #{table} AS base
+    SELECT base.id, '#{table.classify}', p.id, #{transform(original_columns)} FROM #{table} AS base
     SQL
     sql_rest = <<-SQL
     JOIN projects AS p ON (base.customized_id = p.id)
     JOIN custom_fields AS f ON (base.custom_field_id = f.id)
-    JOIN custom_fields_projects AS r ON (base.custom_field_id = r.custom_field_id)
     SQL
     sql = "#{sql_base} #{sql_rest} WHERE searchable = true;"
     execute(sql)

from redmine_full_text_search.

iquiw avatar iquiw commented on June 1, 2024

With the patch, the migration process was finished without error.

However, I got undefined method `display_score?' error when trying to open issue page.
I will check it and file new issue if necessary.

Thanks.

from redmine_full_text_search.

okkez avatar okkez commented on June 1, 2024

Thank you for confirmation.

from redmine_full_text_search.

iquiw avatar iquiw commented on June 1, 2024

For the record, it turns out undefined method `display_score?' happened when using both Full text search and redmine_persist_wfmt.

So it might not be problem of Full text search, although I don't know how the problem happens.

from redmine_full_text_search.

okkez avatar okkez commented on June 1, 2024

Thank you for reporting. I will investigate the issue later.

from redmine_full_text_search.

okkez avatar okkez commented on June 1, 2024

@iquiw I've tried to install redmine_persist_wfmt. But it does not support recent Redmine, I think.

from redmine_full_text_search.

iquiw avatar iquiw commented on June 1, 2024

@okkez I see. Thank you for trying!

Unfortunately, the plugin is required for my use case.
I will try to find workaround or consider to give it up.

from redmine_full_text_search.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.