gitlab-elasticsearch-git 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +1 -1
- data/Gemfile.lock +3 -3
- data/lib/elasticsearch/git/repository.rb +20 -42
- data/lib/elasticsearch/git/version.rb +1 -1
- data/spec/support/elastic_helper.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1ed1a40fac4c237888663a8b9a15606a77c09d0
|
4
|
+
data.tar.gz: 28c65fcdcb6953ed270d4c6e4d5ee91137e7fa04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69199b236f9ee39ea45b38928272cf3c968af829a49d3c27c87b4f0a4b8b9c783d3b7b7f95ce255b9b22e8d433cc6834ce1797c25150fac60c1d798dd446960d
|
7
|
+
data.tar.gz: f164040b0925cabbdce3c4f37d5818141d084665001ea55f800284a2b04e69e8f0b2534533f88074de9192921f749627f09ebba367eaa2f7256d0a4b56425011
|
data/.gitlab-ci.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-elasticsearch-git (1.
|
4
|
+
gitlab-elasticsearch-git (1.1.0)
|
5
5
|
activemodel (~> 4.2)
|
6
6
|
activesupport (~> 4.2)
|
7
7
|
charlock_holmes (~> 0.7)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
minitest (~> 5.1)
|
23
23
|
thread_safe (~> 0.3, >= 0.3.4)
|
24
24
|
tzinfo (~> 1.1)
|
25
|
-
builder (3.2.
|
25
|
+
builder (3.2.3)
|
26
26
|
charlock_holmes (0.7.3)
|
27
27
|
coderay (1.1.0)
|
28
28
|
diff-lcs (1.2.5)
|
@@ -95,4 +95,4 @@ DEPENDENCIES
|
|
95
95
|
rugged (~> 0.24)
|
96
96
|
|
97
97
|
BUNDLED WITH
|
98
|
-
1.
|
98
|
+
1.13.6
|
@@ -21,55 +21,52 @@ module Elasticsearch
|
|
21
21
|
include Elasticsearch::Git::Model
|
22
22
|
include Elasticsearch::Git::EncoderHelper
|
23
23
|
|
24
|
-
mapping
|
24
|
+
mapping _parent: { type: 'project' } do
|
25
25
|
indexes :blob do
|
26
|
-
indexes :id, type: :
|
26
|
+
indexes :id, type: :text,
|
27
27
|
index_options: 'offsets',
|
28
28
|
analyzer: :sha_analyzer
|
29
|
-
indexes :rid, type: :
|
30
|
-
|
31
|
-
indexes :oid, type: :string,
|
29
|
+
indexes :rid, type: :keyword
|
30
|
+
indexes :oid, type: :text,
|
32
31
|
index_options: 'offsets',
|
33
32
|
analyzer: :sha_analyzer
|
34
|
-
indexes :commit_sha, type: :
|
33
|
+
indexes :commit_sha, type: :text,
|
35
34
|
index_options: 'offsets',
|
36
35
|
analyzer: :sha_analyzer
|
37
|
-
indexes :path, type: :
|
36
|
+
indexes :path, type: :text,
|
38
37
|
analyzer: :path_analyzer
|
39
|
-
indexes :file_name, type: :
|
38
|
+
indexes :file_name, type: :text,
|
40
39
|
analyzer: :code_analyzer,
|
41
40
|
search_analyzer: :code_search_analyzer
|
42
|
-
indexes :content, type: :
|
41
|
+
indexes :content, type: :text,
|
43
42
|
index_options: 'offsets',
|
44
43
|
analyzer: :code_analyzer,
|
45
44
|
search_analyzer: :code_search_analyzer
|
46
|
-
indexes :language, type: :
|
47
|
-
index: :not_analyzed
|
45
|
+
indexes :language, type: :keyword
|
48
46
|
end
|
49
47
|
|
50
48
|
indexes :commit do
|
51
|
-
indexes :id, type: :
|
49
|
+
indexes :id, type: :text,
|
52
50
|
index_options: 'offsets',
|
53
51
|
analyzer: :sha_analyzer
|
54
|
-
indexes :rid, type: :
|
55
|
-
|
56
|
-
indexes :sha, type: :string,
|
52
|
+
indexes :rid, type: :keyword
|
53
|
+
indexes :sha, type: :text,
|
57
54
|
index_options: 'offsets',
|
58
55
|
analyzer: :sha_analyzer
|
59
56
|
|
60
57
|
indexes :author do
|
61
|
-
indexes :name, type: :
|
62
|
-
indexes :email, type: :
|
58
|
+
indexes :name, type: :text, index_options: 'offsets'
|
59
|
+
indexes :email, type: :text, index_options: 'offsets'
|
63
60
|
indexes :time, type: :date, format: :basic_date_time_no_millis
|
64
61
|
end
|
65
62
|
|
66
63
|
indexes :commiter do
|
67
|
-
indexes :name, type: :
|
68
|
-
indexes :email, type: :
|
64
|
+
indexes :name, type: :text, index_options: 'offsets'
|
65
|
+
indexes :email, type: :text, index_options: 'offsets'
|
69
66
|
indexes :time, type: :date, format: :basic_date_time_no_millis
|
70
67
|
end
|
71
68
|
|
72
|
-
indexes :message, type: :
|
69
|
+
indexes :message, type: :text, index_options: 'offsets'
|
73
70
|
end
|
74
71
|
end
|
75
72
|
|
@@ -465,16 +462,7 @@ module Elasticsearch
|
|
465
462
|
|
466
463
|
options[:order] = :default if options[:order].blank?
|
467
464
|
|
468
|
-
|
469
|
-
when :recently_indexed
|
470
|
-
{ _timestamp: { order: :desc, mode: :min } }
|
471
|
-
when :last_indexed
|
472
|
-
{ _timestamp: { order: :asc, mode: :min } }
|
473
|
-
else
|
474
|
-
{}
|
475
|
-
end
|
476
|
-
|
477
|
-
query_hash[:sort] = order.blank? ? [:_score] : [order, :_score]
|
465
|
+
query_hash[:sort] = [:_score]
|
478
466
|
|
479
467
|
res = self.__elasticsearch__.search(query_hash)
|
480
468
|
{
|
@@ -527,26 +515,16 @@ module Elasticsearch
|
|
527
515
|
|
528
516
|
options[:order] = :default if options[:order].blank?
|
529
517
|
|
530
|
-
|
531
|
-
when :recently_indexed
|
532
|
-
{ _timestamp: { order: :desc, mode: :min } }
|
533
|
-
when :last_indexed
|
534
|
-
{ _timestamp: { order: :asc, mode: :min } }
|
535
|
-
else
|
536
|
-
{}
|
537
|
-
end
|
538
|
-
|
539
|
-
query_hash[:sort] = order.blank? ? [:_score] : [order, :_score]
|
518
|
+
query_hash[:sort] = [:_score]
|
540
519
|
|
541
520
|
if options[:highlight]
|
542
521
|
query_hash[:highlight] = {
|
543
522
|
pre_tags: ["gitlabelasticsearch→"],
|
544
523
|
post_tags: ["←gitlabelasticsearch"],
|
524
|
+
order: "score",
|
545
525
|
fields: {
|
546
526
|
"blob.content" => {},
|
547
527
|
"blob.file_name" => {},
|
548
|
-
"type" => "fvh",
|
549
|
-
"boundary_chars" => "\n"
|
550
528
|
}
|
551
529
|
}
|
552
530
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-elasticsearch-git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Kumanyaev
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: elasticsearch-model
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.5.
|
162
|
+
rubygems_version: 2.5.2
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Elasticsearch integrations for git repositories.
|