Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-12-03 00:47:33 +0300
committerJan Provaznik <jprovaznik@gitlab.com>2018-12-06 11:25:09 +0300
commit58bfd733310effa94af0e1f1f19e53e34235cffc (patch)
treee793b8f8b2669034e80b7668304f3fc75dc23deb /lib/gitlab/search/query.rb
parent00acef434031b5dc0bf39576a9e83802c7806842 (diff)
Optimized file search to work without limits
* removed 100 limit on file search results because we load all results anyway * expensive processing (parsing match content, utf encoding) is done only for selected page in paginated output
Diffstat (limited to 'lib/gitlab/search/query.rb')
-rw-r--r--lib/gitlab/search/query.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/search/query.rb b/lib/gitlab/search/query.rb
index 7f69083a492..ba0e16607a6 100644
--- a/lib/gitlab/search/query.rb
+++ b/lib/gitlab/search/query.rb
@@ -3,6 +3,8 @@
module Gitlab
module Search
class Query < SimpleDelegator
+ include EncodingHelper
+
def initialize(query, filter_opts = {}, &block)
@raw_query = query.dup
@filters = []
@@ -50,7 +52,9 @@ module Gitlab
end
def parse_filter(filter, input)
- filter[:parser].call(input)
+ result = filter[:parser].call(input)
+
+ @filter_options[:encode_binary] ? encode_binary(result) : result
end
end
end