mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
Fixes #5887 - Knowledge Base search extremely slow despite fast Elasticsearch response
This commit is contained in:
parent
e0136e4313
commit
b465e615b2
3 changed files with 23 additions and 1 deletions
|
|
@ -58,7 +58,7 @@ class App.KnowledgeBaseSearchFieldWidget extends App.Controller
|
|||
|
||||
@delay( =>
|
||||
@makeRequest(query)
|
||||
, 100, 'makeRequest')
|
||||
, 500, 'makeRequest')
|
||||
|
||||
data: (query) ->
|
||||
attrs = {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ class InitializeKnowledgeBase < ActiveRecord::Migration[5.0]
|
|||
t.references :published_by, foreign_key: { to_table: :users }
|
||||
|
||||
t.timestamps limit: 3, null: false
|
||||
|
||||
# Covers published (published+internal) and internal (published+internal+archived) scopes
|
||||
t.index %i[published_at archived_at internal_at], name: 'index_kb_answers_publishing_dates'
|
||||
# Covers archived scope
|
||||
t.index [:archived_at]
|
||||
end
|
||||
|
||||
create_table :knowledge_base_answer_translation_contents do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
||||
|
|
|
|||
17
db/migrate/20251212150958_kb_add_dates_index.rb
Normal file
17
db/migrate/20251212150958_kb_add_dates_index.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
|
||||
|
||||
class KbAddDatesIndex < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
# return if it's a new setup
|
||||
return if !Setting.exists?(name: 'system_init_done')
|
||||
|
||||
change_table :knowledge_base_answers do |t|
|
||||
# Covers published (published+internal) and internal (published+internal+archived) scopes
|
||||
t.index %i[published_at archived_at internal_at], name: 'index_kb_answers_publishing_dates'
|
||||
# Covers archived scope
|
||||
t.index [:archived_at]
|
||||
end
|
||||
|
||||
KnowledgeBase::Answer.reset_column_information
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue