diff --git a/app/models/user/search_index.rb b/app/models/user/search_index.rb index eb4b8a9c7..3254a3a5e 100644 --- a/app/models/user/search_index.rb +++ b/app/models/user/search_index.rb @@ -16,11 +16,13 @@ returns =end def search_index_data - data = [] - data.push "#{ self['firstname'] } #{ self['lastname'] }" + attributes = { 'fullname' => "#{ self['firstname'] } #{ self['lastname'] }" } ['login', 'firstname', 'lastname', 'phone', 'email', 'city', 'country', 'note'].each { |key| - data.push self[key] if self[key] + if self[key] && !self[key].empty? + attributes[key] = self[key] + end } - data + return if attributes.empty? + attributes end end \ No newline at end of file