hydra-access-controls 0.0.5 → 5.0.0.pre1
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.
- data/Rakefile +10 -4
- data/config/solr.yml +2 -4
- data/hydra-access-controls.gemspec +2 -2
- data/lib/hydra-access-controls.rb +3 -8
- data/lib/hydra/ability.rb +4 -8
- data/lib/hydra/policy_aware_access_controls_enforcement.rb +2 -2
- data/lib/hydra/role_mapper_behavior.rb +1 -1
- data/spec/unit/policy_aware_access_controls_enforcement_spec.rb +5 -2
- metadata +6 -15
- data/.gitignore +0 -19
- data/.gitmodules +0 -3
- data/.rspec +0 -2
- data/Gemfile +0 -17
- data/LICENSE +0 -22
- data/config/jetty.yml +0 -5
- data/lib/hydra-access-controls/version.rb +0 -7
- data/solr_conf/conf/schema.xml +0 -124
- data/solr_conf/conf/solrconfig.xml +0 -329
- data/solr_conf/solr.xml +0 -35
data/Rakefile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
require "bundler/gem_tasks"
|
3
3
|
require 'rspec/core/rake_task'
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
APP_ROOT= File.expand_path(File.join(File.dirname(__FILE__),".."))
|
6
|
+
require 'jettywrapper'
|
6
7
|
# re-using hydra_jetty.rake from hydra-head
|
7
|
-
import "lib/tasks/hydra_jetty.rake"
|
8
|
+
#import "lib/tasks/hydra_jetty.rake"
|
8
9
|
import "lib/tasks/hydra-access-controls.rake"
|
9
10
|
|
10
11
|
desc 'Default: run specs.'
|
@@ -16,4 +17,9 @@ RSpec::Core::RakeTask.new do |t|
|
|
16
17
|
t.rcov = true
|
17
18
|
t.rcov_opts = %w{--exclude spec\/*,gems\/*,ruby\/* --aggregate coverage.data}
|
18
19
|
end
|
19
|
-
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "clean"
|
23
|
+
task :clean do
|
24
|
+
#nop, required by hydra-head ci
|
25
|
+
end
|
data/config/solr.yml
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
development:
|
2
|
-
|
3
|
-
url: http://localhost:<%= ENV['TEST_JETTY_PORT'] || 8983 %>/solr/development
|
2
|
+
url: http://localhost:<%= ENV['TEST_JETTY_PORT'] || 8983 %>/solr/development
|
4
3
|
test:
|
5
|
-
|
6
|
-
url: http://localhost:<%= ENV['TEST_JETTY_PORT'] || 8983 %>/solr/test
|
4
|
+
url: http://localhost:<%= ENV['TEST_JETTY_PORT'] || 8983 %>/solr/test
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
version = File.read(File.expand_path("../../HYDRA_VERSION", __FILE__)).strip
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Chris Beer", "Justin Coyne", "Matt Zumwalt"]
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "hydra-access-controls"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version =
|
16
|
+
gem.version = version
|
17
17
|
|
18
18
|
gem.add_dependency 'activesupport'
|
19
19
|
gem.add_dependency 'active-fedora'
|
@@ -1,13 +1,6 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'active-fedora'
|
3
3
|
require 'cancan'
|
4
|
-
require 'deprecation'
|
5
|
-
require "hydra-access-controls/version"
|
6
|
-
begin
|
7
|
-
require 'hydra/model_mixins'
|
8
|
-
rescue LoadError
|
9
|
-
end
|
10
|
-
require 'hydra/datastream'
|
11
4
|
|
12
5
|
module Hydra
|
13
6
|
extend ActiveSupport::Autoload
|
@@ -16,12 +9,14 @@ module Hydra
|
|
16
9
|
autoload :PolicyAwareAccessControlsEnforcement
|
17
10
|
autoload :AccessControlsEvaluation
|
18
11
|
autoload :Ability
|
12
|
+
autoload :Datastream
|
19
13
|
autoload :PolicyAwareAbility
|
20
14
|
autoload :AdminPolicy
|
21
15
|
autoload :RoleMapperBehavior
|
22
16
|
|
23
17
|
module ModelMixins
|
24
|
-
|
18
|
+
extend ActiveSupport::Autoload
|
19
|
+
autoload :RightsMetadata
|
25
20
|
end
|
26
21
|
|
27
22
|
# This error is raised when a user isn't allowed to access a given controller action.
|
data/lib/hydra/ability.rb
CHANGED
@@ -25,14 +25,10 @@ module Hydra::Ability
|
|
25
25
|
|
26
26
|
def hydra_default_permissions(user, session)
|
27
27
|
logger.debug("Usergroups are " + user_groups(user, session).inspect)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
edit_permissions(user, session)
|
33
|
-
read_permissions(user, session)
|
34
|
-
custom_permissions(user, session)
|
35
|
-
end
|
28
|
+
create_permissions(user, session)
|
29
|
+
edit_permissions(user, session)
|
30
|
+
read_permissions(user, session)
|
31
|
+
custom_permissions(user, session)
|
36
32
|
end
|
37
33
|
|
38
34
|
def create_permissions(user, session)
|
@@ -7,7 +7,7 @@ module Hydra::PolicyAwareAccessControlsEnforcement
|
|
7
7
|
super
|
8
8
|
additional_clauses = policy_clauses
|
9
9
|
unless additional_clauses.nil? || additional_clauses.empty?
|
10
|
-
solr_parameters[:fq].first << " OR " +
|
10
|
+
solr_parameters[:fq].first << " OR " + additional_clauses
|
11
11
|
logger.debug("POLICY-aware Solr parameters: #{ solr_parameters.inspect }")
|
12
12
|
end
|
13
13
|
end
|
@@ -67,4 +67,4 @@ module Hydra::PolicyAwareAccessControlsEnforcement
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
end
|
70
|
+
end
|
@@ -15,7 +15,7 @@ module Hydra::RoleMapperBehavior
|
|
15
15
|
if user_or_uid.kind_of?(String)
|
16
16
|
user = ::User.find_by_user_key(user_or_uid)
|
17
17
|
user_id = user_or_uid
|
18
|
-
elsif user_or_uid.kind_of?(::User) && user_or_uid.user_key
|
18
|
+
elsif user_or_uid.kind_of?(::User) && user_or_uid.user_key
|
19
19
|
user = user_or_uid
|
20
20
|
user_id = user.user_key
|
21
21
|
end
|
@@ -66,7 +66,7 @@ describe Hydra::PolicyAwareAccessControlsEnforcement do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
after(:all) do
|
69
|
-
@
|
69
|
+
@sample_policies.each {|p| p.delete }
|
70
70
|
end
|
71
71
|
|
72
72
|
subject { MockController.new }
|
@@ -97,6 +97,9 @@ describe Hydra::PolicyAwareAccessControlsEnforcement do
|
|
97
97
|
|
98
98
|
describe "apply_gated_discovery" do
|
99
99
|
it "should include policy-aware query" do
|
100
|
+
# stubbing out policies_with_access because solr doesn't always return them in the same order.
|
101
|
+
policy_pids = (1..6).map {|n| "test:policy#{n}"}
|
102
|
+
subject.should_receive(:policies_with_access).and_return(policy_pids)
|
100
103
|
subject.apply_gated_discovery(@solr_parameters, @user_parameters)
|
101
104
|
@solr_parameters[:fq].first.should include(" OR (is_governed_by_s:info\\:fedora/test\\:policy1 OR is_governed_by_s:info\\:fedora/test\\:policy2 OR is_governed_by_s:info\\:fedora/test\\:policy3 OR is_governed_by_s:info\\:fedora/test\\:policy4 OR is_governed_by_s:info\\:fedora/test\\:policy5 OR is_governed_by_s:info\\:fedora/test\\:policy6)")
|
102
105
|
end
|
@@ -106,4 +109,4 @@ describe Hydra::PolicyAwareAccessControlsEnforcement do
|
|
106
109
|
@solr_parameters[:fq].first.should_not include(" OR (is_governed_by_s:info\\:fedora/test\\:policy1 OR is_governed_by_s:info\\:fedora/test\\:policy2 OR is_governed_by_s:info\\:fedora/test\\:policy3 OR is_governed_by_s:info\\:fedora/test\\:policy4 OR is_governed_by_s:info\\:fedora/test\\:policy5 OR is_governed_by_s:info\\:fedora/test\\:policy6)")
|
107
110
|
end
|
108
111
|
end
|
109
|
-
end
|
112
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-access-controls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 5.0.0.pre1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Chris Beer
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-09-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -132,20 +132,13 @@ executables: []
|
|
132
132
|
extensions: []
|
133
133
|
extra_rdoc_files: []
|
134
134
|
files:
|
135
|
-
- .gitignore
|
136
|
-
- .gitmodules
|
137
|
-
- .rspec
|
138
|
-
- Gemfile
|
139
|
-
- LICENSE
|
140
135
|
- README.textile
|
141
136
|
- Rakefile
|
142
137
|
- config/fedora.yml
|
143
|
-
- config/jetty.yml
|
144
138
|
- config/solr.yml
|
145
139
|
- hydra-access-controls.gemspec
|
146
140
|
- lib/ability.rb
|
147
141
|
- lib/hydra-access-controls.rb
|
148
|
-
- lib/hydra-access-controls/version.rb
|
149
142
|
- lib/hydra/ability.rb
|
150
143
|
- lib/hydra/access_controls_enforcement.rb
|
151
144
|
- lib/hydra/access_controls_evaluation.rb
|
@@ -161,9 +154,6 @@ files:
|
|
161
154
|
- lib/role_mapper.rb
|
162
155
|
- lib/tasks/hydra-access-controls.rake
|
163
156
|
- lib/tasks/hydra_jetty.rake
|
164
|
-
- solr_conf/conf/schema.xml
|
165
|
-
- solr_conf/conf/solrconfig.xml
|
166
|
-
- solr_conf/solr.xml
|
167
157
|
- spec/factories.rb
|
168
158
|
- spec/spec_helper.rb
|
169
159
|
- spec/support/blacklight.rb
|
@@ -197,9 +187,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
188
|
none: false
|
199
189
|
requirements:
|
200
|
-
- - ! '
|
190
|
+
- - ! '>'
|
201
191
|
- !ruby/object:Gem::Version
|
202
|
-
version:
|
192
|
+
version: 1.3.1
|
203
193
|
requirements: []
|
204
194
|
rubyforge_project:
|
205
195
|
rubygems_version: 1.8.24
|
@@ -225,3 +215,4 @@ test_files:
|
|
225
215
|
- spec/unit/policy_aware_access_controls_enforcement_spec.rb
|
226
216
|
- spec/unit/rights_metadata_spec.rb
|
227
217
|
- spec/unit/role_mapper_spec.rb
|
218
|
+
has_rdoc:
|
data/.gitignore
DELETED
data/.gitmodules
DELETED
data/.rspec
DELETED
data/Gemfile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in hydra-access-controls.gemspec
|
4
|
-
gemspec
|
5
|
-
|
6
|
-
group :development do
|
7
|
-
gem 'jettywrapper'
|
8
|
-
gem 'debugger', :platform => :mri_19
|
9
|
-
end
|
10
|
-
|
11
|
-
group :test do
|
12
|
-
gem 'cucumber-rails', '>=1.2.0', :require=>false
|
13
|
-
gem 'rcov', :platform => :mri_18
|
14
|
-
gem 'simplecov', :platform => :mri_19
|
15
|
-
gem 'simplecov-rcov', :platform => :mri_19
|
16
|
-
gem 'factory_girl', '< 3.0.0' # factory girl 3+ doesn't work with ruby 1.8
|
17
|
-
end
|
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 TODO: Write your name
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/config/jetty.yml
DELETED
data/solr_conf/conf/schema.xml
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
-
<!--
|
3
|
-
IMPORTANT
|
4
|
-
This copy of the solr schema is only used in the context of testing hydra-head. If you want to make changes available to individual hydra heads, you must apply them to the template in lib/generators/hydra/templates/solr_config
|
5
|
-
-->
|
6
|
-
<schema name="Hydra" version="1.1">
|
7
|
-
<!-- For complete comments from the Solr project example schema.xml:
|
8
|
-
http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/schema.xml?view=markup
|
9
|
-
See also:
|
10
|
-
http://wiki.apache.org/solr/SchemaXml
|
11
|
-
-->
|
12
|
-
<types>
|
13
|
-
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
|
14
|
-
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
|
15
|
-
<fieldType name="integer" class="solr.IntField" omitNorms="true"/>
|
16
|
-
<fieldType name="long" class="solr.LongField" omitNorms="true"/>
|
17
|
-
<fieldType name="float" class="solr.FloatField" omitNorms="true"/>
|
18
|
-
<fieldType name="double" class="solr.DoubleField" omitNorms="true"/>
|
19
|
-
<fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
|
20
|
-
<fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
|
21
|
-
<fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
|
22
|
-
<fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
|
23
|
-
<fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
|
24
|
-
<fieldType name="random" class="solr.RandomSortField" indexed="true" />
|
25
|
-
|
26
|
-
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
|
27
|
-
<analyzer>
|
28
|
-
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
29
|
-
</analyzer>
|
30
|
-
</fieldType>
|
31
|
-
|
32
|
-
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
|
33
|
-
<analyzer type="index">
|
34
|
-
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
35
|
-
<filter class="solr.StopFilterFactory"
|
36
|
-
ignoreCase="true"
|
37
|
-
words="stopwords.txt"
|
38
|
-
enablePositionIncrements="true"
|
39
|
-
/>
|
40
|
-
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
|
41
|
-
<filter class="solr.LowerCaseFilterFactory"/>
|
42
|
-
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
|
43
|
-
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
44
|
-
</analyzer>
|
45
|
-
<analyzer type="query">
|
46
|
-
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
47
|
-
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
|
48
|
-
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
|
49
|
-
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
|
50
|
-
<filter class="solr.LowerCaseFilterFactory"/>
|
51
|
-
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
|
52
|
-
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
53
|
-
</analyzer>
|
54
|
-
</fieldType>
|
55
|
-
|
56
|
-
<fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
|
57
|
-
<analyzer>
|
58
|
-
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
59
|
-
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
|
60
|
-
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
|
61
|
-
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
|
62
|
-
<filter class="solr.LowerCaseFilterFactory"/>
|
63
|
-
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
|
64
|
-
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
65
|
-
</analyzer>
|
66
|
-
</fieldType>
|
67
|
-
|
68
|
-
<fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
|
69
|
-
<analyzer>
|
70
|
-
<tokenizer class="solr.KeywordTokenizerFactory"/>
|
71
|
-
<filter class="solr.LowerCaseFilterFactory" />
|
72
|
-
<filter class="solr.TrimFilterFactory" />
|
73
|
-
<filter class="solr.PatternReplaceFilterFactory"
|
74
|
-
pattern="([^a-z])" replacement="" replace="all"
|
75
|
-
/>
|
76
|
-
</analyzer>
|
77
|
-
</fieldType>
|
78
|
-
|
79
|
-
<fieldtype name="ignored" stored="false" indexed="false" class="solr.StrField" />
|
80
|
-
|
81
|
-
</types>
|
82
|
-
|
83
|
-
<!-- For complete comments from the Solr project example schema.xml:
|
84
|
-
http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/schema.xml?view=markup
|
85
|
-
See also:
|
86
|
-
http://wiki.apache.org/solr/SchemaXml
|
87
|
-
-->
|
88
|
-
<fields>
|
89
|
-
|
90
|
-
<field name="id" type="string" indexed="true" stored="true" required="true" />
|
91
|
-
<field name="text" type="text" indexed="true" stored="true" multiValued="true"/>
|
92
|
-
<field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
|
93
|
-
|
94
|
-
<!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
|
95
|
-
<field name="format" type="string" indexed="true" stored="true"/>
|
96
|
-
<!-- pub_date is assumed by Blacklight's default configuration, so we must define it here to avoid errors -->
|
97
|
-
<field name="pub_date" type="string" indexed="true" stored="true" multiValued="true"/>
|
98
|
-
|
99
|
-
<dynamicField name="*_i" type="sint" indexed="true" stored="true"/>
|
100
|
-
<dynamicField name="*_s" type="string" indexed="true" stored="true" multiValued="true"/>
|
101
|
-
<dynamicField name="*_l" type="slong" indexed="true" stored="true"/>
|
102
|
-
<dynamicField name="*_t" type="text" indexed="true" stored="true" multiValued="true"/>
|
103
|
-
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
|
104
|
-
<dynamicField name="*_f" type="sfloat" indexed="true" stored="true"/>
|
105
|
-
<dynamicField name="*_d" type="sdouble" indexed="true" stored="true"/>
|
106
|
-
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
|
107
|
-
|
108
|
-
<dynamicField name="random*" type="random" />
|
109
|
-
<!-- FIXME: Solr can't sort on a multivalued field -->
|
110
|
-
<dynamicField name="*_sort" type="string" indexed="true" stored="false" multiValued="true"/>
|
111
|
-
<!-- FIXME: generally, facet fields are not stored -->
|
112
|
-
<dynamicField name="*_facet" type="string" indexed="true" stored="true" multiValued="true" />
|
113
|
-
<dynamicField name="*_display" type="string" indexed="false" stored="true" multiValued="true" />
|
114
|
-
|
115
|
-
</fields>
|
116
|
-
|
117
|
-
<uniqueKey>id</uniqueKey>
|
118
|
-
<defaultSearchField>text</defaultSearchField>
|
119
|
-
<solrQueryParser defaultOperator="AND" />
|
120
|
-
<copyField source="*_facet" dest="text" />
|
121
|
-
<copyField source="*_t" dest="text" />
|
122
|
-
<copyField source="*_s" dest="text" />
|
123
|
-
|
124
|
-
</schema>
|
@@ -1,329 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
-
<config>
|
3
|
-
<!-- For complete comments from the Solr project example solrconfig.xml:
|
4
|
-
http://svn.apache.org/repos/asf/lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml
|
5
|
-
See also:
|
6
|
-
http://wiki.apache.org/solr/SolrConfigXml
|
7
|
-
-->
|
8
|
-
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
|
9
|
-
|
10
|
-
<indexDefaults>
|
11
|
-
<useCompoundFile>false</useCompoundFile>
|
12
|
-
<mergeFactor>10</mergeFactor>
|
13
|
-
<ramBufferSizeMB>32</ramBufferSizeMB>
|
14
|
-
<maxMergeDocs>2147483647</maxMergeDocs>
|
15
|
-
<maxFieldLength>10000</maxFieldLength>
|
16
|
-
<writeLockTimeout>1000</writeLockTimeout>
|
17
|
-
<commitLockTimeout>10000</commitLockTimeout>
|
18
|
-
<lockType>single</lockType>
|
19
|
-
</indexDefaults>
|
20
|
-
|
21
|
-
<mainIndex>
|
22
|
-
<useCompoundFile>false</useCompoundFile>
|
23
|
-
<ramBufferSizeMB>32</ramBufferSizeMB>
|
24
|
-
<mergeFactor>10</mergeFactor>
|
25
|
-
<maxMergeDocs>2147483647</maxMergeDocs>
|
26
|
-
<maxFieldLength>10000</maxFieldLength>
|
27
|
-
<unlockOnStartup>false</unlockOnStartup>
|
28
|
-
</mainIndex>
|
29
|
-
|
30
|
-
<jmx />
|
31
|
-
|
32
|
-
<!-- the default high-performance update handler -->
|
33
|
-
<updateHandler class="solr.DirectUpdateHandler2">
|
34
|
-
</updateHandler>
|
35
|
-
|
36
|
-
|
37
|
-
<query>
|
38
|
-
<maxBooleanClauses>1024</maxBooleanClauses>
|
39
|
-
<filterCache class="solr.LRUCache"
|
40
|
-
size="512"
|
41
|
-
initialSize="512"
|
42
|
-
autowarmCount="128"/>
|
43
|
-
<queryResultCache class="solr.LRUCache"
|
44
|
-
size="512"
|
45
|
-
initialSize="512"
|
46
|
-
autowarmCount="32"/>
|
47
|
-
<documentCache class="solr.LRUCache"
|
48
|
-
size="512"
|
49
|
-
initialSize="512"
|
50
|
-
autowarmCount="0"/>
|
51
|
-
<enableLazyFieldLoading>true</enableLazyFieldLoading>
|
52
|
-
<queryResultWindowSize>50</queryResultWindowSize>
|
53
|
-
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
|
54
|
-
<HashDocSet maxSize="3000" loadFactor="0.75"/>
|
55
|
-
|
56
|
-
<listener event="newSearcher" class="solr.QuerySenderListener">
|
57
|
-
<arr name="queries">
|
58
|
-
<lst> <str name="q">hydrus</str></lst>
|
59
|
-
</arr>
|
60
|
-
</listener>
|
61
|
-
|
62
|
-
<listener event="firstSearcher" class="solr.QuerySenderListener">
|
63
|
-
<arr name="queries">
|
64
|
-
<lst> <str name="q">hydrus</str></lst>
|
65
|
-
</arr>
|
66
|
-
</listener>
|
67
|
-
|
68
|
-
<useColdSearcher>false</useColdSearcher>
|
69
|
-
<maxWarmingSearchers>2</maxWarmingSearchers>
|
70
|
-
</query>
|
71
|
-
|
72
|
-
<requestDispatcher handleSelect="true" >
|
73
|
-
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
|
74
|
-
<httpCaching lastModifiedFrom="openTime"
|
75
|
-
etagSeed="Solr">
|
76
|
-
</httpCaching>
|
77
|
-
</requestDispatcher>
|
78
|
-
|
79
|
-
<requestHandler name="standard" class="solr.SearchHandler">
|
80
|
-
<lst name="defaults">
|
81
|
-
<str name="echoParams">explicit</str>
|
82
|
-
</lst>
|
83
|
-
</requestHandler>
|
84
|
-
|
85
|
-
<!-- For complete comments from the Solr project example solrconfig.xml:
|
86
|
-
http://svn.apache.org/repos/asf/lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml
|
87
|
-
See also:
|
88
|
-
http://wiki.apache.org/solr/SolrConfigXml
|
89
|
-
-->
|
90
|
-
|
91
|
-
<requestHandler name="search" class="solr.SearchHandler" default="true">
|
92
|
-
<lst name="defaults">
|
93
|
-
<str name="defType">dismax</str>
|
94
|
-
<!-- dismax params -->
|
95
|
-
<str name="mm"> 2<-1 5<-2 6<90% </str>
|
96
|
-
<str name="q.alt">*:*</str>
|
97
|
-
<!-- general -->
|
98
|
-
<str name="facet">true</str>
|
99
|
-
<str name="facet.mincount">1</str>
|
100
|
-
<str name="echoParams">explicit</str>
|
101
|
-
<str name="fl">
|
102
|
-
id,title_t,title_display,date_t,year_facet,month_facet,has_model_s,has_collection_member_s,is_part_of_s,system_create_dt,
|
103
|
-
person_0_role_t,person_1_role_t,person_2_role_t,person_3_role_t,person_4_role_t,person_5_role_t,person_6_role_t,
|
104
|
-
person_7_role_t,person_8_role_t,person_9_role_t,
|
105
|
-
person_0_first_name_t,person_1_first_name_t,person_2_first_name_t,person_3_first_name_t,person_4_first_name_t,
|
106
|
-
person_5_first_name_t,person_6_first_name_t,person_7_first_name_t,person_8_first_name_t,person_9_first_name_t,
|
107
|
-
person_0_last_name_t,person_1_last_name_t,person_2_last_name_t,person_3_last_name_t,person_4_last_name_t,
|
108
|
-
person_5_last_name_t,person_6_last_name_t,person_7_last_name_t,person_8_last_name_t,person_9_last_name_t,
|
109
|
-
status_t,subject_t,depositor_t,
|
110
|
-
journal_title_info_t,journal_issue_publication_date_t,
|
111
|
-
journal_issue_pages_end_t,journal_issue_volume_t,journal_title_info_main_title_t,journal_issue_pages_start_t,
|
112
|
-
journal_issue_start_page_t, journal_issue_end_page_t, abstract_t,
|
113
|
-
person_0_institution_t,person_1_institution_t,person_2_institution_t,person_3_institution_t,person_4_institution_t,person_5_institution_t,person_institution_role_t,
|
114
|
-
person_7_institution_t,person_8_institution_t,person_9_institution_t,
|
115
|
-
mods_gps_t, mods_region_t, mods_site_t, mods_ecosystem_t,
|
116
|
-
mods_timespan_start_t, mods_timespan_end_t, description_t, mods_title_info_main_title_t, mods_0_title_info_0_main_title_t, embargo_release_date_dt, note_t,
|
117
|
-
object_type_facet, department_facet, peer_reviewed_facet
|
118
|
-
</str>
|
119
|
-
</lst>
|
120
|
-
</requestHandler>
|
121
|
-
|
122
|
-
<requestHandler name="public_search" class="solr.SearchHandler" >
|
123
|
-
<lst name="defaults">
|
124
|
-
<!-- Making defType lucene to exclude file assets -->
|
125
|
-
<str name="defType">lucene</str>
|
126
|
-
<!-- lucene params -->
|
127
|
-
<str name="df">has_model_s</str>
|
128
|
-
<str name="q.op">AND</str>
|
129
|
-
<!-- dismax params -->
|
130
|
-
<str name="mm"> 2<-1 5<-2 6<90% </str>
|
131
|
-
<str name="q.alt">*:*</str>
|
132
|
-
<str name="qf_dismax">id^0.8 id_t^0.8 format text^0.3</str>
|
133
|
-
<str name="pf_dismax">id^0.9 id_t^0.9 text^0.5</str>
|
134
|
-
<int name="ps">100</int>
|
135
|
-
<float name="tie">0.01</float>
|
136
|
-
<!-- general -->
|
137
|
-
<str name="facet">on</str>
|
138
|
-
<str name="facet.mincount">1</str>
|
139
|
-
<str name="echoParams">explicit</str>
|
140
|
-
<str name="fl">
|
141
|
-
id,text,title_t,date_t,year_facet,month_facet,medium_t,series_facet,box_facet,folder_facet,has_model_s,has_collection_member_s,system_create_dt,
|
142
|
-
person_0_role_t,person_1_role_t,person_2_role_t,person_3_role_t,person_4_role_t,person_5_role_t,person_6_role_t,person_7_role_t,person_8_role_t,person_9_role_t,
|
143
|
-
person_0_first_name_t,person_1_first_name_t,person_2_first_name_t,person_3_first_name_t,person_4_first_name_t,person_5_first_name_t,person_6_first_name_t,person_7_first_name_t,person_8_first_name_t,person_9_first_name_t,
|
144
|
-
person_0_last_name_t,person_1_last_name_t,person_2_last_name_t,person_3_last_name_t,person_4_last_name_t,person_5_last_name_t,person_6_last_name_t,person_7_last_name_t,person_8_last_name_t,person_9_last_name_t,depositor_t,
|
145
|
-
|
146
|
-
journal_title_info_t, journal_title_info_main_title_t, journal_issue_publication_date_t, journal_issue_pages_start_t, journal_issue_pages_end_t, journal_issue_volume_t, journal_issue_start_page_t, journal_issue_end_page_t, abstract_t,
|
147
|
-
person_0_institution_t,person_1_institution_t,person_2_institution_t,person_3_institution_t,person_4_institution_t,person_5_institution_t,person_institution_role_t,
|
148
|
-
person_7_institution_t,person_8_institution_t,person_9_institution_t,
|
149
|
-
mods_gps_t, mods_region_t, mods_site_t, mods_ecosystem_t,
|
150
|
-
mods_timespan_start_t, mods_timespan_end_t, description_t, mods_title_info_t,mods_0_title_info_0_main_title_t, embargo_release_date_dt, note_t,
|
151
|
-
object_type_facet, department_facet, peer_reviewed_facet
|
152
|
-
</str>
|
153
|
-
</lst>
|
154
|
-
</requestHandler>
|
155
|
-
|
156
|
-
<requestHandler name="fulltext" class="solr.SearchHandler" >
|
157
|
-
<lst name="defaults">
|
158
|
-
<str name="defType">dismax</str>
|
159
|
-
<str name="facet">on</str>
|
160
|
-
<str name="facet.mincount">1</str>
|
161
|
-
<str name="echoParams">explicit</str>
|
162
|
-
<float name="tie">0.01</float>
|
163
|
-
<str name="qf">id^0.8 id_t^0.8 format text^0.3</str>
|
164
|
-
<str name="pf">id^0.9 id_t^0.9 text^0.5</str>
|
165
|
-
<str name="fl">
|
166
|
-
id,text,title_t,date_t,year_facet,month_facet,medium_t,series_facet,box_facet,folder_facet
|
167
|
-
</str>
|
168
|
-
<str name="mm"> 2<-1 5<-2 6<90% </str>
|
169
|
-
<int name="ps">100</int>
|
170
|
-
<str name="q.alt">*:*</str>
|
171
|
-
</lst>
|
172
|
-
</requestHandler>
|
173
|
-
|
174
|
-
<!--
|
175
|
-
Hydra Permissions request Handler
|
176
|
-
For requests to get just the permissions related info about a document
|
177
|
-
-->
|
178
|
-
<requestHandler name="permissions" class="solr.SearchHandler" >
|
179
|
-
<lst name="defaults">
|
180
|
-
<str name="facet">off</str>
|
181
|
-
<str name="echoParams">all</str>
|
182
|
-
<str name="rows">1</str>
|
183
|
-
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
184
|
-
<str name="fl">
|
185
|
-
id,access_t,
|
186
|
-
discover_access_group_t,discover_access_person_t,
|
187
|
-
read_access_group_t,read_access_person_t,
|
188
|
-
edit_access_group_t,edit_access_person_t,
|
189
|
-
depositor_t,
|
190
|
-
embargo_release_date_dt
|
191
|
-
inheritable_access_t,
|
192
|
-
inheritable_discover_access_group_t,inheritable_discover_access_person_t,
|
193
|
-
inheritable_read_access_group_t,inheritable_read_access_person_t,
|
194
|
-
inheritable_edit_access_group_t,inheritable_edit_access_person_t,
|
195
|
-
inheritable_embargo_release_date_dt
|
196
|
-
</str>
|
197
|
-
</lst>
|
198
|
-
</requestHandler>
|
199
|
-
|
200
|
-
<!-- for requests to get a single document; use id=666 instead of q=id:666 -->
|
201
|
-
<requestHandler name="document" class="solr.SearchHandler" >
|
202
|
-
<lst name="defaults">
|
203
|
-
<str name="echoParams">all</str>
|
204
|
-
<str name="fl">*</str>
|
205
|
-
<str name="rows">1</str>
|
206
|
-
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
207
|
-
|
208
|
-
<!-- facets on for a single document response??? -->
|
209
|
-
<str name="facet">on</str>
|
210
|
-
<str name="facet.mincount">1</str>
|
211
|
-
|
212
|
-
<str name="facet.field">collection_facet</str>
|
213
|
-
<str name="facet.field">technology_facet</str>
|
214
|
-
<str name="facet.field">person_facet</str>
|
215
|
-
<!-- <str name="facet.field">title_t</str> -->
|
216
|
-
<str name="facet.field">city_facet</str>
|
217
|
-
<str name="facet.field">organization_facet</str>
|
218
|
-
<str name="facet.field">company_facet</str>
|
219
|
-
<str name="facet.field">year_facet</str>
|
220
|
-
<str name="facet.field">state_facet</str>
|
221
|
-
<str name="facet.field">series_facet</str>
|
222
|
-
<str name="facet.field">box_facet</str>
|
223
|
-
<str name="facet.field">folder_facet</str>
|
224
|
-
<str name="facet.field">donor_tags_facet</str>
|
225
|
-
<str name="facet.field">archivist_tags_facet</str>
|
226
|
-
|
227
|
-
</lst>
|
228
|
-
</requestHandler>
|
229
|
-
|
230
|
-
<!-- The spell check component can return a list of alternative spelling
|
231
|
-
suggestions. -->
|
232
|
-
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
|
233
|
-
|
234
|
-
<str name="queryAnalyzerFieldType">textSpell</str>
|
235
|
-
|
236
|
-
<lst name="spellchecker">
|
237
|
-
<str name="name">default</str>
|
238
|
-
<str name="field">spell</str>
|
239
|
-
<str name="spellcheckIndexDir">./spellchecker1</str>
|
240
|
-
|
241
|
-
</lst>
|
242
|
-
<lst name="spellchecker">
|
243
|
-
<str name="name">jarowinkler</str>
|
244
|
-
<str name="field">spell</str>
|
245
|
-
<!-- Use a different Distance Measure -->
|
246
|
-
<str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
|
247
|
-
<str name="spellcheckIndexDir">./spellchecker2</str>
|
248
|
-
|
249
|
-
</lst>
|
250
|
-
|
251
|
-
<lst name="spellchecker">
|
252
|
-
<str name="classname">solr.FileBasedSpellChecker</str>
|
253
|
-
<str name="name">file</str>
|
254
|
-
<str name="sourceLocation">spellings.txt</str>
|
255
|
-
<str name="characterEncoding">UTF-8</str>
|
256
|
-
<str name="spellcheckIndexDir">./spellcheckerFile</str>
|
257
|
-
</lst>
|
258
|
-
</searchComponent>
|
259
|
-
|
260
|
-
<!-- a request handler utilizing the spellcheck component -->
|
261
|
-
<requestHandler name="/spellCheckCompRH" class="solr.SearchHandler">
|
262
|
-
<lst name="defaults">
|
263
|
-
<!-- omp = Only More Popular -->
|
264
|
-
<str name="spellcheck.onlyMorePopular">false</str>
|
265
|
-
<!-- exr = Extended Results -->
|
266
|
-
<str name="spellcheck.extendedResults">false</str>
|
267
|
-
<!-- The number of suggestions to return -->
|
268
|
-
<str name="spellcheck.count">1</str>
|
269
|
-
</lst>
|
270
|
-
<arr name="last-components">
|
271
|
-
<str>spellcheck</str>
|
272
|
-
</arr>
|
273
|
-
</requestHandler>
|
274
|
-
|
275
|
-
<!-- a search component that enables you to configure the top results for
|
276
|
-
a given query regardless of the normal lucene scoring.-->
|
277
|
-
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
|
278
|
-
<!-- pick a fieldType to analyze queries -->
|
279
|
-
<str name="queryFieldType">string</str>
|
280
|
-
<str name="config-file">elevate.xml</str>
|
281
|
-
</searchComponent>
|
282
|
-
|
283
|
-
<!-- a request handler utilizing the elevator component -->
|
284
|
-
<requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
|
285
|
-
<lst name="defaults">
|
286
|
-
<str name="echoParams">explicit</str>
|
287
|
-
</lst>
|
288
|
-
<arr name="last-components">
|
289
|
-
<str>elevator</str>
|
290
|
-
</arr>
|
291
|
-
</requestHandler>
|
292
|
-
|
293
|
-
<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
|
294
|
-
<requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
|
295
|
-
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
|
296
|
-
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
|
297
|
-
<requestHandler name="/admin/ping" class="PingRequestHandler">
|
298
|
-
<lst name="defaults">
|
299
|
-
<str name="qt">standard</str>
|
300
|
-
<str name="q">solrpingquery</str>
|
301
|
-
<str name="echoParams">all</str>
|
302
|
-
</lst>
|
303
|
-
</requestHandler>
|
304
|
-
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
|
305
|
-
<lst name="defaults">
|
306
|
-
<str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
|
307
|
-
<str name="echoHandler">true</str>
|
308
|
-
</lst>
|
309
|
-
</requestHandler>
|
310
|
-
|
311
|
-
<!--
|
312
|
-
<queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
|
313
|
-
<queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
|
314
|
-
<queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
|
315
|
-
-->
|
316
|
-
|
317
|
-
<!-- XSLT response writer transforms the XML output by any xslt file found
|
318
|
-
in Solr's conf/xslt directory. Changes to xslt files are checked for
|
319
|
-
every xsltCacheLifetimeSeconds.
|
320
|
-
-->
|
321
|
-
<queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
|
322
|
-
<int name="xsltCacheLifetimeSeconds">5</int>
|
323
|
-
</queryResponseWriter>
|
324
|
-
|
325
|
-
<admin>
|
326
|
-
<defaultQuery>hydra</defaultQuery>
|
327
|
-
</admin>
|
328
|
-
|
329
|
-
</config>
|
data/solr_conf/solr.xml
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
-
<!--
|
3
|
-
Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
-
contributor license agreements. See the NOTICE file distributed with
|
5
|
-
this work for additional information regarding copyright ownership.
|
6
|
-
The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
-
(the "License"); you may not use this file except in compliance with
|
8
|
-
the License. You may obtain a copy of the License at
|
9
|
-
|
10
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
|
12
|
-
Unless required by applicable law or agreed to in writing, software
|
13
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
See the License for the specific language governing permissions and
|
16
|
-
limitations under the License.
|
17
|
-
-->
|
18
|
-
|
19
|
-
<!--
|
20
|
-
All (relative) paths are relative to the installation path
|
21
|
-
|
22
|
-
persistent: Save changes made via the API to this file
|
23
|
-
sharedLib: path to a lib directory that will be shared across all cores
|
24
|
-
-->
|
25
|
-
<solr persistent="false">
|
26
|
-
|
27
|
-
<!--
|
28
|
-
adminPath: RequestHandler path to manage cores.
|
29
|
-
If 'null' (or absent), cores will not be manageable via REST
|
30
|
-
-->
|
31
|
-
<cores adminPath="/admin/cores">
|
32
|
-
<core name="core0" instanceDir="core0" />
|
33
|
-
<core name="core1" instanceDir="core1" />
|
34
|
-
</cores>
|
35
|
-
</solr>
|