common_indexer 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/schema.json +31 -4
- data/config/settings.json +0 -10
- data/lib/common_indexer.rb +1 -8
- data/lib/common_indexer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db62cbc76077d2796deb4adbae93aa3c7b34a4e08108a4803e7dc7f026332b22
|
4
|
+
data.tar.gz: b19d7cc054255b15766f995efa45846b6a4b8848b0bb88853a4e6fba66a89ccc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f77ead6629442cf436b346d32c8dbaa355af894f092aa75edac5c9fb550ed1b03c56b144cc677fb71a504dac829c88b622a71fc9fd8d8a371f8ac78b54ac19
|
7
|
+
data.tar.gz: '0164482b997687f9438b0749cd2911178f5c3e1adb1d5d36d58049deb78d2db4962d7c30adafaebb542e82264fde312aa82f3195b43a21c52c044c9ae047f2fe'
|
data/config/schema.json
CHANGED
@@ -1,13 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"properties": {
|
3
3
|
"full_text": {
|
4
|
-
"type": "text"
|
5
|
-
|
4
|
+
"type": "text",
|
5
|
+
"analyzer": "phrase_analyzer",
|
6
|
+
"search_analyzer": "keyword_analyzer",
|
7
|
+
"search_quote_analyzer": "phrase_analyzer"
|
8
|
+
},
|
6
9
|
"all_titles": {
|
7
|
-
"type": "text"
|
10
|
+
"type": "text",
|
11
|
+
"analyzer": "phrase_analyzer",
|
12
|
+
"search_analyzer": "keyword_analyzer",
|
13
|
+
"search_quote_analyzer": "phrase_analyzer"
|
8
14
|
},
|
9
15
|
"all_subjects": {
|
10
|
-
"type": "text"
|
16
|
+
"type": "text",
|
17
|
+
"analyzer": "phrase_analyzer",
|
18
|
+
"search_analyzer": "keyword_analyzer",
|
19
|
+
"search_quote_analyzer": "phrase_analyzer"
|
11
20
|
}
|
12
21
|
},
|
13
22
|
"dynamic_templates": [
|
@@ -29,6 +38,9 @@
|
|
29
38
|
"match": "^date",
|
30
39
|
"mapping": {
|
31
40
|
"type": "text",
|
41
|
+
"analyzer": "phrase_analyzer",
|
42
|
+
"search_analyzer": "keyword_analyzer",
|
43
|
+
"search_quote_analyzer": "phrase_analyzer",
|
32
44
|
"fields": {
|
33
45
|
"keyword": { "type": "keyword" }
|
34
46
|
}
|
@@ -52,6 +64,9 @@
|
|
52
64
|
"path_match": "subject.label",
|
53
65
|
"mapping": {
|
54
66
|
"type": "text",
|
67
|
+
"analyzer": "phrase_analyzer",
|
68
|
+
"search_analyzer": "keyword_analyzer",
|
69
|
+
"search_quote_analyzer": "phrase_analyzer",
|
55
70
|
"copy_to": [
|
56
71
|
"full_text",
|
57
72
|
"all_subjects"
|
@@ -67,6 +82,9 @@
|
|
67
82
|
"path_match": "title.*",
|
68
83
|
"mapping": {
|
69
84
|
"type": "text",
|
85
|
+
"analyzer": "phrase_analyzer",
|
86
|
+
"search_analyzer": "keyword_analyzer",
|
87
|
+
"search_quote_analyzer": "phrase_analyzer",
|
70
88
|
"fields": {
|
71
89
|
"keyword": { "type": "keyword" }
|
72
90
|
},
|
@@ -79,6 +97,9 @@
|
|
79
97
|
"path_match": "*.title",
|
80
98
|
"mapping": {
|
81
99
|
"type": "text",
|
100
|
+
"analyzer": "phrase_analyzer",
|
101
|
+
"search_analyzer": "keyword_analyzer",
|
102
|
+
"search_quote_analyzer": "phrase_analyzer",
|
82
103
|
"fields": {
|
83
104
|
"keyword": { "type": "keyword" }
|
84
105
|
},
|
@@ -91,6 +112,9 @@
|
|
91
112
|
"path_match": "*.label",
|
92
113
|
"mapping": {
|
93
114
|
"type": "text",
|
115
|
+
"analyzer": "phrase_analyzer",
|
116
|
+
"search_analyzer": "keyword_analyzer",
|
117
|
+
"search_quote_analyzer": "phrase_analyzer",
|
94
118
|
"fields": {
|
95
119
|
"keyword": { "type": "keyword" }
|
96
120
|
},
|
@@ -103,6 +127,9 @@
|
|
103
127
|
"match_mapping_type": "string",
|
104
128
|
"mapping": {
|
105
129
|
"type": "text",
|
130
|
+
"analyzer": "phrase_analyzer",
|
131
|
+
"search_analyzer": "keyword_analyzer",
|
132
|
+
"search_quote_analyzer": "phrase_analyzer",
|
106
133
|
"fields": {
|
107
134
|
"keyword": {
|
108
135
|
"type": "keyword",
|
data/config/settings.json
CHANGED
data/lib/common_indexer.rb
CHANGED
@@ -33,7 +33,6 @@ module CommonIndexer # :nodoc:
|
|
33
33
|
def configure_index!
|
34
34
|
new_index = [index_name, Time.now.utc.strftime('%Y%m%d%H%M%S%3N')].join('_')
|
35
35
|
create_index(new_index)
|
36
|
-
apply_settings(new_index)
|
37
36
|
reindex_into(new_index) if client.indices.exists(index: index_name)
|
38
37
|
client.indices.put_alias(index: new_index, name: index_name)
|
39
38
|
end
|
@@ -41,16 +40,10 @@ module CommonIndexer # :nodoc:
|
|
41
40
|
private
|
42
41
|
|
43
42
|
def create_index(new_index)
|
44
|
-
client.indices.create(index: new_index)
|
43
|
+
client.indices.create(index: new_index, body: config.settings)
|
45
44
|
client.indices.put_mapping(index: new_index, type: '_doc', body: { _doc: config.schema })
|
46
45
|
end
|
47
46
|
|
48
|
-
def apply_settings(new_index)
|
49
|
-
client.indices.close(index: new_index)
|
50
|
-
client.indices.put_settings(index: new_index, body: config.settings)
|
51
|
-
client.indices.open(index: new_index)
|
52
|
-
end
|
53
|
-
|
54
47
|
def reindex_into(new_index)
|
55
48
|
existing_index = client.indices.get(index: index_name).keys.first
|
56
49
|
raise ArgumentError, "Cannot reindex #{index_name} into itself" if existing_index == new_index
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: common_indexer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-03-
|
12
|
+
date: 2020-03-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active-fedora
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: '0'
|
239
239
|
requirements: []
|
240
|
-
rubygems_version: 3.
|
240
|
+
rubygems_version: 3.0.3
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: Common Indexing mixin for NUL Digital Collections
|