clear-code / redmine_full_text_search

Full text search for Redmine
MIT License
61 stars 24 forks source link

Can't use with redmine_questions or redmine_issue_evm #77

Closed omosun closed 4 years ago

omosun commented 4 years ago

Can I use this plugin(master repository) with "redmine_questions" or "redmine_issue_evm" plugins?

with "redmine_questions" or "redmine_issue_evm"

Started GET "/search?utf8=%E2%9C%93&scope=&q=aaa" for 192.168.XXX.XXX at 2019-12-10 23:22:59 +0900
Processing by SearchController#index as HTML
  Parameters: {"utf8"=>"?", "scope"=>"", "q"=>"aaa"}
  Current user: admin (id=1)
[full-text-search][search] {"search_id":"1575987779.916633","q":"aaa","scope":"","all_words":"1","titles_only":"0","attachments":"1","open_issues":"0","offset":0,"limit":10,"order_target":"score","order_type":"desc","options":"0","issues":"1","news":"1","documents":"1","changesets":"1","wiki_pages":"1","messages":"1","projects":"1","changes":"1","questions":"1","evmbaselines":"1","tags":[],"user_id":1,"project_id":null,"n_hits":0,"total_n_hits":0,"elapsed_time":0.013285160064697266,"timestamp":"2019-12-10T14:22:59Z"}
  Rendering plugins/full_text_search/app/views/search/index.html.erb within layouts/base
  Rendered plugins/full_text_search/app/views/search/index.html.erb within layouts/base (109.6ms)
Completed 500 Internal Server Error in 215ms (ActiveRecord: 60.3ms)

ActionView::Template::Error (undefined method `question' for FullTextSearch::Type(id: integer, name: string):Class):
    157:         </li>^M
    158:         <% @search_request.search_types.each do |type| %>^M
    159:           <li>^M
    160:             <%= link_to("#{type_label(type)} (#{@result_set.source_drilldown(type)})",^M
    161:                         url_for(@search_request.to_params(types: [type])),^M
    162:                         id: "search-target-#{type.gsub(/_/, "-")}",^M
    163:                         class: @search_request.target?(type) ? "selecte
d" : "") %>^M

plugins/full_text_search/app/models/full_text_search/type.rb:15:in `[]'
plugins/full_text_search/lib/full_text_search/searcher.rb:322:in `source_drilldown'
plugins/full_text_search/app/views/search/index.html.erb:160:in `block in _plugins_full_text_search_app_views_search_index_html_erb__1012560022634019890_46939940553700'
plugins/full_text_search/app/views/search/index.html.erb:158:in `each'
plugins/full_text_search/app/views/search/index.html.erb:158:in `_plugins_full_text_search_app_views_search_index_html_erb__1012560022634019890_46939940553700'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

I try to remove "redmine_questions", and then restart and search.

ActionView::Template::Error (undefined method `evmbaseline' for FullTextSearch::Type(id: integer, name: string):Class):
kou commented 4 years ago

Thanks for your report. I've fixed this. Could you try master?

omosun commented 4 years ago

Thanks for the deal. But, It was like this.

Started GET "/search?utf8=%E2%9C%93&scope=&q=%E3%81%A0%E3%82%88%E3%82%93" for 192.168.3XXX.XXX at 2019-12-15 16:37:14 +0900
Processing by SearchController#index as HTML
  Parameters: {"utf8"=>"?", "scope"=>"", "q"=>"だよん"}
  Current user: anonymous
Completed 500 Internal Server Error in 425ms (ActiveRecord: 218.6ms)

NoMethodError (undefined method `question' for FullTextSearch::Type(id: integer, name: string):Class):

plugins/full_text_search/app/models/full_text_search/type.rb:15:in `[]'
plugins/full_text_search/lib/full_text_search/searcher.rb:185:in `block in filter'
plugins/full_text_search/lib/full_text_search/searcher.rb:180:in `each'
plugins/full_text_search/lib/full_text_search/searcher.rb:180:in `filter'
plugins/full_text_search/lib/full_text_search/searcher.rb:14:in `search'
plugins/full_text_search/lib/full_text_search/hooks/controller_search_index.rb:29:in `index'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
kou commented 4 years ago

Oh. Could you try the current master again?

omosun commented 4 years ago

Thank you for a good job! I was able to search.