summaryrefslogtreecommitdiff
path: root/app/elastic
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2016-01-07 10:54:29 +0200
committerValery Sizov <vsv2711@gmail.com>2016-01-07 10:54:29 +0200
commit8c8b8978cff03344d0331d3bfae4dfa1bedf37af (patch)
treeb30a7722aa687b00bd9b358e79efe1521b2dac37 /app/elastic
parentaacc700c4aa6cfce1db1d09b9029f2e63c0f13b6 (diff)
downloadgitlab-ce-elasticsearch.tar.gz
elastic: almost all integrated exept view logicelasticsearch
Diffstat (limited to 'app/elastic')
-rw-r--r--app/elastic/application_search.rb8
-rw-r--r--app/elastic/groups_search.rb2
-rw-r--r--app/elastic/issues_search.rb2
-rw-r--r--app/elastic/merge_requests_search.rb2
-rw-r--r--app/elastic/projects_search.rb2
-rw-r--r--app/elastic/repositories_search.rb38
-rw-r--r--app/elastic/users_search.rb2
7 files changed, 9 insertions, 47 deletions
diff --git a/app/elastic/application_search.rb b/app/elastic/application_search.rb
index 32a96f11a60..44577e25963 100644
--- a/app/elastic/application_search.rb
+++ b/app/elastic/application_search.rb
@@ -46,10 +46,10 @@ module ApplicationSearch
}
}
- after_commit lambda { Resque.enqueue(Elastic::BaseIndexer, :index, self.class.to_s, self.id) }, on: :create
- after_commit lambda { Resque.enqueue(Elastic::BaseIndexer, :update, self.class.to_s, self.id) }, on: :update
- after_commit lambda { Resque.enqueue(Elastic::BaseIndexer, :delete, self.class.to_s, self.id) }, on: :destroy
- after_touch lambda { Resque.enqueue(Elastic::BaseIndexer, :update, self.class.to_s, self.id) }
+ # after_commit lambda { Resque.enqueue(Elastic::BaseIndexer, :index, self.class.to_s, self.id) }, on: :create
+ # after_commit lambda { Resque.enqueue(Elastic::BaseIndexer, :update, self.class.to_s, self.id) }, on: :update
+ # after_commit lambda { Resque.enqueue(Elastic::BaseIndexer, :delete, self.class.to_s, self.id) }, on: :destroy
+ # after_touch lambda { Resque.enqueue(Elastic::BaseIndexer, :update, self.class.to_s, self.id) }
end
module ClassMethods
diff --git a/app/elastic/groups_search.rb b/app/elastic/groups_search.rb
index 35fbc4a617a..2252dd254c4 100644
--- a/app/elastic/groups_search.rb
+++ b/app/elastic/groups_search.rb
@@ -24,7 +24,7 @@ module GroupsSearch
})
end
- def self.search(query, page: 1, per: 20, options: {})
+ def self.elastic_search(query, page: 1, per: 20, options: {})
page ||= 1
diff --git a/app/elastic/issues_search.rb b/app/elastic/issues_search.rb
index 946a0eae892..1b7318b711d 100644
--- a/app/elastic/issues_search.rb
+++ b/app/elastic/issues_search.rb
@@ -41,7 +41,7 @@ module IssuesSearch
})
end
- def self.search(query, page: 1, per: 20, options: {})
+ def self.elastic_search(query, page: 1, per: 20, options: {})
page ||= 1
diff --git a/app/elastic/merge_requests_search.rb b/app/elastic/merge_requests_search.rb
index 175c0c50142..eb0970b06d7 100644
--- a/app/elastic/merge_requests_search.rb
+++ b/app/elastic/merge_requests_search.rb
@@ -47,7 +47,7 @@ module MergeRequestsSearch
})
end
- def self.search(query, page: 1, per: 20, options: {})
+ def self.elastic_search(query, page: 1, per: 20, options: {})
page ||= 1
diff --git a/app/elastic/projects_search.rb b/app/elastic/projects_search.rb
index 8236698590b..b9620cb6616 100644
--- a/app/elastic/projects_search.rb
+++ b/app/elastic/projects_search.rb
@@ -54,7 +54,7 @@ module ProjectsSearch
})
end
- def self.search(query, page: 1, per: 20, options: {})
+ def self.elastic_search(query, page: 1, per: 20, options: {})
page ||= 1
diff --git a/app/elastic/repositories_search.rb b/app/elastic/repositories_search.rb
deleted file mode 100644
index d97a73241be..00000000000
--- a/app/elastic/repositories_search.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module RepositoriesSearch
- extend ActiveSupport::Concern
-
- included do
- include Elasticsearch::Git::Repository
-
- self.__elasticsearch__.client = Elasticsearch::Client.new host: Gitlab.config.elasticsearch.host, port: Gitlab.config.elasticsearch.port
-
- def repository_id
- project.id
- end
-
- def self.repositories_count
- Project.count
- end
-
- def client_for_indexing
- self.__elasticsearch__.client
- end
-
- def self.import
- Repository.__elasticsearch__.create_index! force: true
-
- Project.find_each do |project|
- if project.repository.exists? && !project.repository.empty?
- begin
- project.repository.index_commits
- rescue
- end
- begin
- project.repository.index_blobs
- rescue
- end
- end
- end
- end
- end
-end
diff --git a/app/elastic/users_search.rb b/app/elastic/users_search.rb
index 9e86f77a7ad..60b5ddaa4b2 100644
--- a/app/elastic/users_search.rb
+++ b/app/elastic/users_search.rb
@@ -31,7 +31,7 @@ module UsersSearch
})
end
- def self.search(query, page: 1, per: 20, options: {})
+ def self.elastic_search(query, page: 1, per: 20, options: {})
page ||= 1
per ||= 20