hydra 7.0.0 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Hydra-Recipes.md +9 -1
- data/doc/Indexing-non-English-content.md +45 -0
- data/doc/Lesson:-Define-Relationships-Between-Objects.md +3 -3
- data/doc/Lesson:-Generate-Rails-Scaffolding-for-Creating-and-Editing-Books.md +1 -1
- data/doc/Lesson:-adding-content-datastreams.md +4 -4
- data/doc/Lesson:-build-a-book-model.md +3 -3
- data/doc/Lesson:-install-hydra-jetty.md +6 -0
- data/doc/Lesson:-make-blacklight-return-search-results.md +3 -3
- data/hydra.gemspec +7 -7
- data/lib/hydra/version.rb +1 -1
- data/script/changelog.sh +3 -9
- metadata +17 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af11fbafc2cb92fb77c3cf7c82f4c16e6b70b349
|
4
|
+
data.tar.gz: 6af18c8e04cca1800ad03d2461f27adffd574ea7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3760f9be5683badf70a974e841dd3555a200cbeb5d79049b22b9d7a280e46e4e76c26263626388cb13854790c9f7a8d473fb1680d10d0fce6f62bfbd46653062
|
7
|
+
data.tar.gz: 72d8d542411398662cb402a3e567530749322a51649bfeb26475a4150ed06d488ead9213b6aa785b3739cdd86a9a42e953b106c34f2237a5620b5d7fc9fa11c9
|
data/doc/Hydra-Recipes.md
CHANGED
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
**Caveat emptor:** These "recipes" are community contributions, not officially supported Hydra "solutions". YMMV.
|
2
|
+
|
3
|
+
***
|
4
|
+
|
5
|
+
[[Use HTTP POST for Solr requests]] - This may be necessary if Hydra's Solr requests, due to access control conditions, become too long for the default HTTP GET method.
|
6
|
+
|
7
|
+
[[Indexing non English content]] - if you are indexing non English content into Hydra, you may want to update your Solr config to take advantage of Solr's language specific stemming capabilities.
|
8
|
+
|
9
|
+
[Uniqueness validator for ActiveFedora](https://gist.github.com/dchandekstark/f969ad21bf518c7cd3c5) - Inspired by the ActiveRecord uniqueness validator, with some limitations.
|
@@ -0,0 +1,45 @@
|
|
1
|
+
_Note - the information in this page only refers to our (The Royal Library of Denmark) experience with this problem. Please feel free to edit or update this page with corrections or additional information._
|
2
|
+
|
3
|
+
## Background
|
4
|
+
|
5
|
+
By default, Hydra will index all text content as Solr dynamic fields of type `*_tesim`.
|
6
|
+
```xml
|
7
|
+
<dynamicField name="*_tesim" type="text_en" stored="true" indexed="true" multiValued="true"/>
|
8
|
+
```
|
9
|
+
This means that all text stored like this will be indexed according to the rules specified in the ```text_en``` field type. This is defined to use stemming rules appropriate for the English language. For example, the text `appointment` will also be stored as `appoint` and will be retrievable by searches for both values.
|
10
|
+
|
11
|
+
Obviously, this is inappropriate if your Hydra head will store content in a language other than English as users will need to specify the exact text string they are searching for in order to retrieve content. To give an example from our case, the search `Minister` will not retrieve documents with titles such as `Ministeren` (Danish, the minister).
|
12
|
+
|
13
|
+
## A quick and dirty solution
|
14
|
+
|
15
|
+
The dynamic field name `*_tesim` is generated by Solrizer. The optimal solution would be to pass Solrizer extra arguments when calling it in order to generate a different type of dynamic field which would in turn refer to a different Solr field type. I couldn't find any obvious way to do this, so instead I ended up customising the `text_en` field type as follows:
|
16
|
+
|
17
|
+
```xml
|
18
|
+
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
|
19
|
+
<analyzer>
|
20
|
+
<tokenizer class="solr.ICUTokenizerFactory"/>
|
21
|
+
<filter class="solr.ICUFoldingFilterFactory"/> <!-- NFKC, case folding, diacritics removed -->
|
22
|
+
<filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
|
23
|
+
<filter class="solr.TrimFilterFactory"/>
|
24
|
+
</analyzer>
|
25
|
+
</fieldType>
|
26
|
+
```
|
27
|
+
Here, I have removed the English specific stemming filters and added a filter with a Danish configuration. A huge number of different languages are supported by Solr without any extra configuration needed. See the [Language Analysis](https://wiki.apache.org/solr/LanguageAnalysis) page in the Solr Wiki and look under your language to see if it is supported.
|
28
|
+
|
29
|
+
If your content is already indexed in Solr, you can re-index without needing to re-import. Simply restart Solr with the new configuration, log into a rails console for the appropriate environment and enter:
|
30
|
+
```ruby
|
31
|
+
ActiveFedora::Base.all.each{ |e| e.update_index }
|
32
|
+
```
|
33
|
+
This will run through all objects in your repository and update the index according to the new configuration. It may take a bit of time if you have a lot of content in your repository.
|
34
|
+
|
35
|
+
## A better solution?
|
36
|
+
|
37
|
+
The above solution is problematic in that it modifies the `text_en` field type to store non-English content. This is a bit confusing. A better solution would be to define a new field type e.g. `text_da` containing the same values which can be referenced from the `*_tesim` dynamic field definition e.g.
|
38
|
+
```xml
|
39
|
+
<dynamicField name="*_tesim" type="text_da" stored="true" indexed="true" multiValued="true"/>
|
40
|
+
```
|
41
|
+
Alternatively, if Solrizer can be called to generate custom fields type, it should be utilised to generate a custom dynamic field such as `*_tdsim` which in turn references the `text_da` field type. I don't know how to do this, but anyone who does is more than welcome to update this guide with that information.
|
42
|
+
|
43
|
+
## Finally...
|
44
|
+
|
45
|
+
In writing this documentation, I discovered that [Solr's example schema](http://svn.apache.org/repos/asf/lucene/dev/branches/lucene_solr_3_6/solr/example/solr/conf/schema.xml) contains example field configurations for a wide range of different languages which are more detailed than the example I have provided above. Try and apply these configurations for your language and see if they work as expected. Please note however that I have not tried these examples myself, so I cannot promise that they will work with the Solr shipped with Jetty.
|
@@ -121,9 +121,9 @@ The answer is that active-fedora has a config file that it uses to look up RDF p
|
|
121
121
|
|
122
122
|
Now that we've added page relationships, it's a great time to commit to git:
|
123
123
|
|
124
|
-
```
|
125
|
-
|
126
|
-
|
124
|
+
```text
|
125
|
+
git add .
|
126
|
+
git commit -m "Created a book page model with relationship to the book model"
|
127
127
|
```
|
128
128
|
|
129
129
|
# Next Step
|
@@ -34,8 +34,8 @@ To add the file to one of our page objects, open up the console again:
|
|
34
34
|
Now you're ready to add the file. Choose a file on your computer that you want to add as the "pageContent". In the lines below we're pretending that the path to the file is "/Users/adamw/Desktop/page1.pdf". Replace that with the correct local path for the file you want to use.
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
> p.pageContent.content = File.open("
|
38
|
-
=> #<File
|
37
|
+
> p.pageContent.content = File.open("../AK Page 4.pdf")
|
38
|
+
=> #<File:../AK Page 4.pdf>
|
39
39
|
> p.save
|
40
40
|
=> true
|
41
41
|
```
|
@@ -49,8 +49,8 @@ Now if you go to [[http://localhost:8983/fedora/objects/changeme:2/datastreams]]
|
|
49
49
|
Now that we've added a content datastream, it's a great time to commit to git:
|
50
50
|
|
51
51
|
```bash
|
52
|
-
|
53
|
-
|
52
|
+
git add .
|
53
|
+
git commit -m "Created a content datastream"
|
54
54
|
```
|
55
55
|
|
56
56
|
# Next Step
|
@@ -254,9 +254,9 @@ Now your object is indexed properly, but it **won't show up in Blacklight's sear
|
|
254
254
|
|
255
255
|
Now that we've got our model working, it's a great time to commit to git:
|
256
256
|
|
257
|
-
```
|
258
|
-
|
259
|
-
|
257
|
+
```text
|
258
|
+
git add .
|
259
|
+
git commit -m "Created a book model and a datastream"
|
260
260
|
```
|
261
261
|
|
262
262
|
# Next Step
|
@@ -25,6 +25,12 @@ Use the hydra:jetty generator to install the hydra-jetty package by running:
|
|
25
25
|
rails g hydra:jetty
|
26
26
|
```
|
27
27
|
|
28
|
+
Note: this requires that your system have curl installed. If it does not, you may see an unhelpful error:
|
29
|
+
|
30
|
+
```text
|
31
|
+
Unable to download jetty from https://github.com/projecthydra/hydra-jetty/archive/v7.0.0.zip
|
32
|
+
```
|
33
|
+
|
28
34
|
This generator is provided by the jettywrapper gem.
|
29
35
|
|
30
36
|
|
@@ -59,9 +59,9 @@ Save the file, and refresh your web browser. You should now see a result for "An
|
|
59
59
|
|
60
60
|
Now that we've updated our search functionality, it's a great time to commit to git:
|
61
61
|
|
62
|
-
```
|
63
|
-
|
64
|
-
|
62
|
+
```text
|
63
|
+
git add .
|
64
|
+
git commit -m "Disabled access controls and set default search fields"
|
65
65
|
```
|
66
66
|
|
67
67
|
# Next Step
|
data/hydra.gemspec
CHANGED
@@ -23,16 +23,16 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.require_paths = ["lib"]
|
24
24
|
gem.license = 'APACHE2'
|
25
25
|
|
26
|
-
gem.add_dependency 'hydra-head', '~> 7.0
|
27
|
-
gem.add_dependency 'jettywrapper', '~> 1.
|
28
|
-
gem.add_dependency 'active-fedora', '~> 7.0
|
26
|
+
gem.add_dependency 'hydra-head', '~> 7.2.0'
|
27
|
+
gem.add_dependency 'jettywrapper', '~> 1.8.2'
|
28
|
+
gem.add_dependency 'active-fedora', '~> 7.1.0'
|
29
29
|
gem.add_dependency 'rails', '>= 3.2.15', '< 5.0'
|
30
|
-
gem.add_dependency 'om', '~> 3.0
|
31
|
-
gem.add_dependency 'solrizer', '~> 3.
|
30
|
+
gem.add_dependency 'om', '~> 3.1.0'
|
31
|
+
gem.add_dependency 'solrizer', '~> 3.3.0'
|
32
32
|
gem.add_dependency 'rsolr', '~> 1.0.10'
|
33
|
-
gem.add_dependency 'blacklight', '~> 5.
|
33
|
+
gem.add_dependency 'blacklight', '~> 5.5.1'
|
34
34
|
gem.add_dependency 'nokogiri', '~> 1.6.0'
|
35
|
-
gem.add_dependency 'rubydora', '~> 1.
|
35
|
+
gem.add_dependency 'rubydora', '~> 1.8.0'
|
36
36
|
gem.add_dependency 'nom-xml', '~> 0.5.1'
|
37
37
|
gem.add_development_dependency 'github_api', '~> 0.10.1'
|
38
38
|
end
|
data/lib/hydra/version.rb
CHANGED
data/script/changelog.sh
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
function show_help() {
|
4
4
|
echo "Usage: changelog.sh [options]"
|
5
|
-
echo "Generates a changelog from git history
|
6
|
-
echo " are merges or contain the following: \"$skip_tag\""
|
5
|
+
echo "Generates a changelog from git history"
|
7
6
|
echo
|
8
7
|
echo "Format:"
|
9
8
|
echo "YYYY-MM-DD: commit subject [committer name]"
|
@@ -19,7 +18,6 @@ function show_help() {
|
|
19
18
|
verbose=0
|
20
19
|
range_parameter=0
|
21
20
|
banner=0
|
22
|
-
skip_tag="\[log skip\]"
|
23
21
|
repository_path="./"
|
24
22
|
|
25
23
|
function default_range() {
|
@@ -75,12 +73,8 @@ function get_format() {
|
|
75
73
|
pretty_format=`get_format`
|
76
74
|
|
77
75
|
function changelog() {
|
78
|
-
# Get a list of all
|
79
|
-
|
80
|
-
# Then requery the log and output format
|
81
|
-
cd $repository_path && git log $range --no-merges --format=%H $@ |
|
82
|
-
grep -v -f <(cd $repository_path && git log $range --no-merges --format=%H --grep="$skip_tag" $@) |
|
83
|
-
git log $range --no-merges --pretty="$pretty_format" --date=short --stdin --no-walk
|
76
|
+
# Get a list of all commits for the ranger that were not merges
|
77
|
+
cd $repository_path && git log $range --no-merges --pretty="$pretty_format" --date=short
|
84
78
|
}
|
85
79
|
|
86
80
|
function main() {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hydra-head
|
@@ -17,42 +17,42 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 7.0
|
20
|
+
version: 7.2.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 7.0
|
27
|
+
version: 7.2.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: jettywrapper
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 1.
|
34
|
+
version: 1.8.2
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 1.
|
41
|
+
version: 1.8.2
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: active-fedora
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 7.0
|
48
|
+
version: 7.1.0
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 7.0
|
55
|
+
version: 7.1.0
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rails
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,28 +79,28 @@ dependencies:
|
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.0
|
82
|
+
version: 3.1.0
|
83
83
|
type: :runtime
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.0
|
89
|
+
version: 3.1.0
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
91
|
name: solrizer
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.
|
96
|
+
version: 3.3.0
|
97
97
|
type: :runtime
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 3.
|
103
|
+
version: 3.3.0
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: rsolr
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,14 +121,14 @@ dependencies:
|
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 5.
|
124
|
+
version: 5.5.1
|
125
125
|
type: :runtime
|
126
126
|
prerelease: false
|
127
127
|
version_requirements: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 5.
|
131
|
+
version: 5.5.1
|
132
132
|
- !ruby/object:Gem::Dependency
|
133
133
|
name: nokogiri
|
134
134
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,14 +149,14 @@ dependencies:
|
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.8.0
|
153
153
|
type: :runtime
|
154
154
|
prerelease: false
|
155
155
|
version_requirements: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.8.0
|
160
160
|
- !ruby/object:Gem::Dependency
|
161
161
|
name: nom-xml
|
162
162
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,6 +209,7 @@ files:
|
|
209
209
|
- doc/For-Developers.md
|
210
210
|
- doc/Home.md
|
211
211
|
- doc/Hydra-Recipes.md
|
212
|
+
- doc/Indexing-non-English-content.md
|
212
213
|
- doc/Lesson:-Define-Relationships-Between-Objects.md
|
213
214
|
- doc/Lesson:-Generate-Rails-Scaffolding-for-Creating-and-Editing-Books.md
|
214
215
|
- doc/Lesson:-Reading-Hydra-rightsMetadata-XML.md
|