Store more ticket attributes in search backend, needed for es queries for stats.

This commit is contained in:
Martin Edenhofer 2015-10-27 08:41:55 +01:00
parent cc2a436dd6
commit 1160e758fc
3 changed files with 12 additions and 30 deletions

View file

@ -305,9 +305,9 @@ returns
lookup model from cache (if exists) or retrieve it from db, id, name or login possible
result = Model.lookup( :id => 123 )
result = Model.lookup( :name => 'some name' )
result = Model.lookup( :login => 'some login' )
result = Model.lookup(id: 123)
result = Model.lookup(name: 'some name')
result = Model.lookup(login: 'some login')
returns
@ -681,10 +681,10 @@ class OwnModel < ApplicationModel
serve methode to configure and enable search index support for this model
class Model < ApplicationModel
search_index_support :ignore_attributes => {
:create_article_type_id => true,
:create_article_sender_id => true,
:article_count => true,
search_index_support ignore_attributes: {
create_article_type_id: true,
create_article_sender_id: true,
article_count: true,
}
end
@ -748,7 +748,7 @@ reload search index with full data
serve methode to configure and enable activity stream support for this model
class Model < ApplicationModel
activity_stream_support :role => 'Admin'
activity_stream_support role: 'Admin'
end
=end
@ -835,7 +835,7 @@ class Model < ApplicationModel
end
class Model < ApplicationModel
history_support :ignore_attributes => { :article_count => true }
history_support ignore_attributes: { article_count: true }
end
=end
@ -1012,8 +1012,8 @@ return object and assets
data = Model.full(123)
data = {
:id => 123,
:assets => assets,
id: 123,
assets: assets,
}
=end

View file

@ -84,14 +84,6 @@ returns
def search_index_attribute_lookup(attributes, ref_object)
# default keep attributes
keep_attributes = {}
if self.class.search_index_support_config[:keep_attributes]
self.class.search_index_support_config[:keep_attributes].each {|key, value|
keep_attributes[key] = value
}
end
attributes_new = {}
attributes.each {|key, value|
next if !value

View file

@ -51,17 +51,7 @@ class Ticket < ApplicationModel
article_count: true,
}
search_index_support(
ignore_attributes: {
create_article_type_id: true,
create_article_sender_id: true,
article_count: true,
},
keep_attributes: {
customer_id: true,
organization_id: true,
},
)
search_index_support
belongs_to :group
has_many :articles, class_name: 'Ticket::Article', after_add: :cache_update, after_remove: :cache_update