blacklight-sitemaps 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +28 -0
- data/Rakefile +41 -0
- data/app/assets/config/blacklight_sitemaps_manifest.js +0 -0
- data/app/views/sitemap/index.xml.builder +14 -0
- data/app/views/sitemap/show.xml.builder +15 -0
- data/config/routes.rb +2 -0
- data/lib/blacklight/sitemaps.rb +7 -0
- data/lib/blacklight/sitemaps/engine.rb +6 -0
- data/lib/blacklight/sitemaps/version.rb +5 -0
- data/lib/generators/blacklight/sitemaps/install_generator.rb +22 -0
- data/lib/generators/blacklight/sitemaps/templates/sitemap_controller.rb +43 -0
- data/lib/generators/blacklight/sitemaps/templates/solrconfig.xml +294 -0
- data/lib/tasks/blacklight/sitemaps_tasks.rake +4 -0
- metadata +157 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4cf589685c84a258eeae5661f42cbe7fcde2360f9d6b4d98c220abd0c7c54d40
|
4
|
+
data.tar.gz: 8c5bc790d0ea183803357e0b499db3e17b268379f65f59b7600ac38b321e0f22
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7fa0f04d05545111a68aeea83b706cce794356343e090bfd381f44d515824d8c8342f9b4726c4166da54a6c94e91846506c9fafe97e20a22f6715244b7f867c5
|
7
|
+
data.tar.gz: 46e1a5b7091463ea2222e0bc6045d79dc4795d8efd01ed42be4f3c568727c38839d4a68f4eac7679fa8342a3c3d70212cdf56343057d66b9669de5d3037f4dde
|
data/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2020 Project Blacklight
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Blacklight::Sitemaps
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'blacklight-sitemaps'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install blacklight-sitemaps
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
Apache 2.0
|
data/Rakefile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Blacklight::Sitemaps'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'bundler/gem_tasks'
|
18
|
+
|
19
|
+
require 'engine_cart/rake_task'
|
20
|
+
|
21
|
+
require 'solr_wrapper'
|
22
|
+
|
23
|
+
require 'rspec/core/rake_task'
|
24
|
+
RSpec::Core::RakeTask.new(:spec)
|
25
|
+
|
26
|
+
task ci: ['engine_cart:generate'] do
|
27
|
+
ENV['environment'] = 'test'
|
28
|
+
|
29
|
+
SolrWrapper.wrap(port: '8983') do |solr|
|
30
|
+
solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path(File.dirname(__FILE__)), '.internal_test_app', 'solr', 'conf')) do
|
31
|
+
within_test_app do
|
32
|
+
system 'bundle install'
|
33
|
+
system 'bundle exec rake db:migrate'
|
34
|
+
system 'bundle exec rails blacklight:index:seed'
|
35
|
+
end
|
36
|
+
|
37
|
+
# run the tests
|
38
|
+
Rake::Task['spec'].invoke
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
xml.instruct! :xml, version: '1.0', encoding: 'UTF-8'
|
4
|
+
xml.sitemapindex(
|
5
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
6
|
+
'xsi:schemaLocation' => 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd',
|
7
|
+
'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9'
|
8
|
+
) do
|
9
|
+
@access_list.each do |id|
|
10
|
+
xml.sitemap do
|
11
|
+
xml.loc(sitemap_url(id, format: :xml))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
xml.instruct! :xml, version: '1.0', encoding: 'UTF-8'
|
4
|
+
xml.urlset(
|
5
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
6
|
+
'xsi:schemaLocation' => 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd',
|
7
|
+
'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9'
|
8
|
+
) do
|
9
|
+
@solr_response['response']['docs'].each do |doc|
|
10
|
+
xml.url do
|
11
|
+
xml.loc(solr_document_url(doc['id']))
|
12
|
+
xml.lastmod(doc['timestamp'])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module Blacklight::Sitemaps
|
6
|
+
class InstallGenerator < Rails::Generators::Base
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
|
9
|
+
def install_sitemap_controller
|
10
|
+
copy_file 'sitemap_controller.rb', 'app/controllers/sitemap_controller.rb'
|
11
|
+
end
|
12
|
+
|
13
|
+
def install_solrconfig_xml
|
14
|
+
copy_file 'solrconfig.xml', 'solr/conf/solrconfig.xml', force: true
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
def install_routing_concern
|
19
|
+
route('resources :sitemap, defaults: { format: :xml }, only: [:index, :show]')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class SitemapController < ApplicationController
|
4
|
+
def index
|
5
|
+
@access_list = access_list
|
6
|
+
end
|
7
|
+
|
8
|
+
def show
|
9
|
+
@solr_response = Blacklight.default_index.connection.select(
|
10
|
+
params:
|
11
|
+
{
|
12
|
+
q: "{!prefix f=hashed_id_si v=#{access_params}}}",
|
13
|
+
defType: 'lucene',
|
14
|
+
fl: 'id,timestamp',
|
15
|
+
facet: false,
|
16
|
+
rows: 3_000_000 # a sufficiently large number to prevent Solr from ever attempting paging
|
17
|
+
}
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def access_params
|
24
|
+
params.require(:id) # :id collides with Solr id but they are different. This is the Sitemap ID.
|
25
|
+
end
|
26
|
+
|
27
|
+
def max_documents
|
28
|
+
Rails.cache.fetch('index_max_docs', expires_in: 1.day) do
|
29
|
+
Blacklight.default_index.connection.select(params: { q: '*:*', rows: 0 })['response']['numFound']
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Important note: 4,000 is a good average_chunk because it's large enough to fit into the 4096 leaves option (3
|
34
|
+
# character placeholders) scheme, and can be rendered by Rails performantly. Larger numbers can tax Rails.
|
35
|
+
def access_list
|
36
|
+
approximate_chunk_size = [4000, max_documents].min # Sufficiently less than 50,000 max per sitemap
|
37
|
+
return [] if approximate_chunk_size == 0
|
38
|
+
access = (Math.log(max_documents / approximate_chunk_size) / Math.log(16)).ceil
|
39
|
+
(0...(16**access))
|
40
|
+
.to_a
|
41
|
+
.map { |v| v.to_s(16).rjust(access, '0') }
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,294 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<config>
|
3
|
+
<!--for Sematext Monitoring-->
|
4
|
+
<jmx />
|
5
|
+
|
6
|
+
<!-- NOTE: various comments and unused configuration possibilities have been purged
|
7
|
+
from this file. Please refer to http://wiki.apache.org/solr/SolrConfigXml,
|
8
|
+
as well as the default solrconfig file included with Solr -->
|
9
|
+
|
10
|
+
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
|
11
|
+
|
12
|
+
<luceneMatchVersion>7.4.0</luceneMatchVersion>
|
13
|
+
|
14
|
+
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
|
15
|
+
|
16
|
+
<!-- solr lib dirs -->
|
17
|
+
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
|
18
|
+
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
|
19
|
+
|
20
|
+
<!-- using default data directory here, for the vanilla Solr installation-->
|
21
|
+
<dataDir>${solr.data.dir:}</dataDir>
|
22
|
+
|
23
|
+
<codecFactory class="solr.SchemaCodecFactory"/>
|
24
|
+
|
25
|
+
<schemaFactory class="ClassicIndexSchemaFactory"/>
|
26
|
+
|
27
|
+
<indexConfig>
|
28
|
+
<!-- native is the default, but let's be safe -->
|
29
|
+
<lockType>${solr.lock.type:native}</lockType>
|
30
|
+
|
31
|
+
<!-- in-memory buffer of 200MB per shard. If it fills up,
|
32
|
+
a hard commit is done, but the transaction log isn't cleared up,
|
33
|
+
so we still have to rely on the hard commit policy -->
|
34
|
+
<ramBufferSizeMB>200</ramBufferSizeMB>
|
35
|
+
</indexConfig>
|
36
|
+
|
37
|
+
<updateHandler class="solr.DirectUpdateHandler2">
|
38
|
+
|
39
|
+
<!-- this is our transaction log for SolrCloud-->
|
40
|
+
<updateLog>
|
41
|
+
<str name="dir">${solr.ulog.dir:}</str>
|
42
|
+
<int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
|
43
|
+
</updateLog>
|
44
|
+
|
45
|
+
<!-- hard commit every 10 minutes or 100K docs, whichever comes first -->
|
46
|
+
<autoCommit>
|
47
|
+
<maxTime>600000</maxTime>
|
48
|
+
<maxDocs>100000</maxDocs>
|
49
|
+
<openSearcher>false</openSearcher>
|
50
|
+
</autoCommit>
|
51
|
+
|
52
|
+
<!-- soft commit every 20 minutes -->
|
53
|
+
<autoSoftCommit>
|
54
|
+
<maxTime>1200000</maxTime>
|
55
|
+
</autoSoftCommit>
|
56
|
+
|
57
|
+
</updateHandler>
|
58
|
+
|
59
|
+
<updateProcessor class="solr.processor.SignatureUpdateProcessorFactory" name="add_hash_id">
|
60
|
+
<bool name="enabled">true</bool>
|
61
|
+
<str name="signatureField">hashed_id_si</str>
|
62
|
+
<bool name="overwriteDupes">false</bool>
|
63
|
+
<str name="fields">id</str>
|
64
|
+
<str name="signatureClass">solr.processor.Lookup3Signature</str>
|
65
|
+
</updateProcessor>
|
66
|
+
|
67
|
+
<updateRequestProcessorChain name="cloud" processor="add_hash_id" default="true">
|
68
|
+
<processor class="solr.LogUpdateProcessorFactory"/>
|
69
|
+
<processor class="solr.DistributedUpdateProcessorFactory"/>
|
70
|
+
<processor class="solr.RunUpdateProcessorFactory"/>
|
71
|
+
</updateRequestProcessorChain>
|
72
|
+
|
73
|
+
<!-- config for the admin interface -->
|
74
|
+
<admin>
|
75
|
+
<defaultQuery>*:*</defaultQuery>
|
76
|
+
</admin>
|
77
|
+
|
78
|
+
|
79
|
+
<requestHandler name="search" class="solr.SearchHandler" default="true">
|
80
|
+
<!-- default values for query parameters can be specified, these
|
81
|
+
will be overridden by parameters in the request
|
82
|
+
-->
|
83
|
+
<lst name="defaults">
|
84
|
+
<str name="defType">edismax</str>
|
85
|
+
<str name="echoParams">explicit</str>
|
86
|
+
<int name="rows">10</int>
|
87
|
+
<str name="q.alt">*:*</str>
|
88
|
+
<str name="mm">2<-1 5<-2 6<90%</str>
|
89
|
+
<int name="qs">1</int>
|
90
|
+
<int name="ps">2</int>
|
91
|
+
<float name="tie">0.01</float>
|
92
|
+
|
93
|
+
<!-- this qf and pf are used by default, if not otherwise specified by
|
94
|
+
client. The default blacklight will use these for the
|
95
|
+
"keywords" search. See the author_qf/author_pf, title_qf, etc
|
96
|
+
below, which the default blacklight will specify for
|
97
|
+
those searches. You may also be interested in:
|
98
|
+
http://wiki.apache.org/solr/LocalParams
|
99
|
+
-->
|
100
|
+
<str name="qf">
|
101
|
+
id
|
102
|
+
title_245ab_unstem_search^100000
|
103
|
+
title_245ab_tsim^25000
|
104
|
+
title_addl_unstem_search^5000
|
105
|
+
title_addl_tsim^2500
|
106
|
+
title_related_unstem_search^1500
|
107
|
+
title_related_tsim^1250
|
108
|
+
subject_topic_unstem_search^1000
|
109
|
+
subject_unstem_search^750
|
110
|
+
subject_topic_facet_sim^625
|
111
|
+
subject_tsim^500
|
112
|
+
author_unstem_search^250
|
113
|
+
author_addl_unstem_search^250
|
114
|
+
author_tsim^100
|
115
|
+
author_addl_tsim^50
|
116
|
+
subject_addl_unstem_search^250
|
117
|
+
subject_addl_tsim^50
|
118
|
+
series_title_unstem_search^25
|
119
|
+
series_title_tsim^10
|
120
|
+
isbn_sim
|
121
|
+
issn_sim
|
122
|
+
toc_ssim
|
123
|
+
notes_summary_ssim
|
124
|
+
all_text_timv
|
125
|
+
</str>
|
126
|
+
<str name="pf">
|
127
|
+
title_245ab_unstem_search^1000000
|
128
|
+
title_245ab_tsim^250000
|
129
|
+
title_addl_unstem_search^50000
|
130
|
+
title_addl_tsim^25000
|
131
|
+
title_related_unstem_search^15000
|
132
|
+
title_related_tsim^12500
|
133
|
+
subject_topic_unstem_search^10000
|
134
|
+
subject_unstem_search^7500
|
135
|
+
subject_topic_facet_sim^6250
|
136
|
+
subject_tsim^5000
|
137
|
+
author_unstem_search^2500
|
138
|
+
author_addl_unstem_search^2500
|
139
|
+
author_tsim^1000
|
140
|
+
author_addl_tsim^500
|
141
|
+
subject_addl_unstem_search^2500
|
142
|
+
subject_addl_tsim^500
|
143
|
+
series_title_unstem_search^250
|
144
|
+
series_title_tsim^100
|
145
|
+
toc_ssim^50
|
146
|
+
notes_summary_ssim^50
|
147
|
+
all_text_timv^10
|
148
|
+
</str>
|
149
|
+
<str name="author_qf">
|
150
|
+
author_unstem_search^200
|
151
|
+
author_addl_unstem_search^50
|
152
|
+
author_tsim^20
|
153
|
+
author_addl_tsim
|
154
|
+
</str>
|
155
|
+
<str name="author_pf">
|
156
|
+
author_unstem_search^2000
|
157
|
+
author_addl_unstem_search^500
|
158
|
+
author_tsim^200
|
159
|
+
author_addl_tsim^10
|
160
|
+
</str>
|
161
|
+
<str name="title_qf">
|
162
|
+
title_unstem_search^75000
|
163
|
+
title_245ab_unstem_search^50000
|
164
|
+
title_addl_unstem_search^10000
|
165
|
+
title_tsim^7500
|
166
|
+
title_245ab_tsim^5000
|
167
|
+
title_addl_tsim^100
|
168
|
+
title_added_entry_unstem_search^50
|
169
|
+
title_added_entry_tsim^10
|
170
|
+
series_title_unstem_search^5
|
171
|
+
series_title_tsim
|
172
|
+
</str>
|
173
|
+
<str name="title_pf">
|
174
|
+
title_unstem_search^750000
|
175
|
+
title_245ab_unstem_search^500000
|
176
|
+
title_addl_unstem_search^100000
|
177
|
+
title_tsim^75000
|
178
|
+
title_245ab_tsim^50000
|
179
|
+
title_addl_tsim^1000
|
180
|
+
title_added_entry_unstem_search^500
|
181
|
+
title_added_entry_tsim^100
|
182
|
+
series_title_unstem_search^50
|
183
|
+
series_title_tsim^10
|
184
|
+
</str>
|
185
|
+
<str name="subject_qf">
|
186
|
+
subject_topic_unstem_search^200
|
187
|
+
subject_unstem_search^125
|
188
|
+
subject_topic_facet_sim^100
|
189
|
+
subject_tsim^50
|
190
|
+
subject_addl_unstem_search^10
|
191
|
+
subject_addl_tsim
|
192
|
+
</str>
|
193
|
+
<str name="subject_pf">
|
194
|
+
subject_topic_unstem_search^2000
|
195
|
+
subject_unstem_search^1250
|
196
|
+
subject_tsim^1000
|
197
|
+
subject_topic_facet_sim^500
|
198
|
+
subject_addl_unstem_search^100
|
199
|
+
subject_addl_tsim^10
|
200
|
+
</str>
|
201
|
+
|
202
|
+
<!-- for advanced search number text box -->
|
203
|
+
<str name="number_qf">
|
204
|
+
id
|
205
|
+
isbn_sim
|
206
|
+
issn_sim
|
207
|
+
oclc_number_ssim
|
208
|
+
lccn_ssim
|
209
|
+
</str>
|
210
|
+
|
211
|
+
<!-- list fields to be displayed in the search results page -->
|
212
|
+
<str name="fl">
|
213
|
+
id,
|
214
|
+
score,
|
215
|
+
title_display_ssm,
|
216
|
+
title_latin_display_ssm,
|
217
|
+
author_person_display_ssm,
|
218
|
+
author_corp_display_ssm,
|
219
|
+
author_meeting_display_ssm,
|
220
|
+
format,
|
221
|
+
overall_imprint_display_ssm,
|
222
|
+
publication_display_ssm,
|
223
|
+
edition_display_ssm,
|
224
|
+
full_links_struct,
|
225
|
+
isbn_valid_ssm,
|
226
|
+
oclc_number_ssim,
|
227
|
+
lccn_ssim
|
228
|
+
</str>
|
229
|
+
|
230
|
+
<!-- list fields to be displayed as facets -->
|
231
|
+
<str name="facet">true</str>
|
232
|
+
<str name="facet.mincount">1</str>
|
233
|
+
<str name="facet.field">access_facet</str>
|
234
|
+
<str name="facet.field">format</str>
|
235
|
+
<str name="facet.field">campus_facet</str>
|
236
|
+
<str name="facet.field">up_library_facet</str>
|
237
|
+
<str name="facet.field">pub_date_itsi</str>
|
238
|
+
<str name="facet.field">language_facet</str>
|
239
|
+
<str name="facet.field">subject_topic_facet</str>
|
240
|
+
<str name="facet.field">genre_facet</str>
|
241
|
+
<str name="facet.field">media_type_facet</str>
|
242
|
+
<str name="facet.field">lc_1letter_facet</str>
|
243
|
+
<str name="facet.field">lc_rest_facet</str>
|
244
|
+
</lst>
|
245
|
+
</requestHandler>
|
246
|
+
|
247
|
+
<!-- for requests to get a single document; use id=666 instead of q=id:666 -->
|
248
|
+
<requestHandler name="document" class="solr.SearchHandler" >
|
249
|
+
<lst name="defaults">
|
250
|
+
<str name="echoParams">all</str>
|
251
|
+
<str name="fl">*,
|
252
|
+
bound_with_title_ssm: [json]</str>
|
253
|
+
<str name="rows">1</str>
|
254
|
+
<str name="q">{!term f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
255
|
+
</lst>
|
256
|
+
</requestHandler>
|
257
|
+
|
258
|
+
<requestHandler name="standard" class="solr.SearchHandler">
|
259
|
+
<lst name="defaults">
|
260
|
+
<str name="echoParams">explicit</str>
|
261
|
+
<str name="defType">lucene</str>
|
262
|
+
</lst>
|
263
|
+
</requestHandler>
|
264
|
+
|
265
|
+
<requestDispatcher handleSelect="true" >
|
266
|
+
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
|
267
|
+
</requestDispatcher>
|
268
|
+
|
269
|
+
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
|
270
|
+
|
271
|
+
<query>
|
272
|
+
<filterCache class="solr.FastLRUCache"
|
273
|
+
size="1000"
|
274
|
+
initialSize="1000"
|
275
|
+
autowarmCount="100"/>
|
276
|
+
|
277
|
+
<queryResultCache class="solr.LRUCache"
|
278
|
+
size="1000"
|
279
|
+
initialSize="1000"
|
280
|
+
autowarmCount="100"/>
|
281
|
+
|
282
|
+
<documentCache class="solr.LRUCache"
|
283
|
+
size="1000"
|
284
|
+
initialSize="1000"/>
|
285
|
+
|
286
|
+
<enableLazyFieldLoading>true</enableLazyFieldLoading>
|
287
|
+
|
288
|
+
<queryResultWindowSize>100</queryResultWindowSize>
|
289
|
+
<queryResultMaxDocsCached>500</queryResultMaxDocsCached>
|
290
|
+
<useColdSearcher>false</useColdSearcher>
|
291
|
+
</query>
|
292
|
+
|
293
|
+
</config>
|
294
|
+
|
metadata
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: blacklight-sitemaps
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jack Reed
|
8
|
+
- Nikitas Tampakis
|
9
|
+
- Michael Gibney
|
10
|
+
- Andrea Gazzarini
|
11
|
+
- Matthias Vandermaesen
|
12
|
+
- Charlie Morris
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
date: 2020-01-07 00:00:00.000000000 Z
|
17
|
+
dependencies:
|
18
|
+
- !ruby/object:Gem::Dependency
|
19
|
+
name: rails
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '5.1'
|
25
|
+
- - "<"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '7'
|
28
|
+
type: :runtime
|
29
|
+
prerelease: false
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '5.1'
|
35
|
+
- - "<"
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '7'
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: blacklight
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '6'
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '6'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: engine_cart
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
type: :development
|
60
|
+
prerelease: false
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: rspec-rails
|
68
|
+
requirement: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
type: :development
|
74
|
+
prerelease: false
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: solr_wrapper
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: sqlite3
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
type: :development
|
102
|
+
prerelease: false
|
103
|
+
version_requirements: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
description: Dynamically generated sitemaps for Blacklight applications
|
109
|
+
email:
|
110
|
+
- phillipjreed@gmail.com
|
111
|
+
- nikitas.tampakis@gmail.com
|
112
|
+
- michael@michaelgibney.net
|
113
|
+
- a.gazzarini@sease.io
|
114
|
+
- matthias@colada.be
|
115
|
+
- cdmorris22@gmail.com
|
116
|
+
executables: []
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- LICENSE
|
121
|
+
- README.md
|
122
|
+
- Rakefile
|
123
|
+
- app/assets/config/blacklight_sitemaps_manifest.js
|
124
|
+
- app/views/sitemap/index.xml.builder
|
125
|
+
- app/views/sitemap/show.xml.builder
|
126
|
+
- config/routes.rb
|
127
|
+
- lib/blacklight/sitemaps.rb
|
128
|
+
- lib/blacklight/sitemaps/engine.rb
|
129
|
+
- lib/blacklight/sitemaps/version.rb
|
130
|
+
- lib/generators/blacklight/sitemaps/install_generator.rb
|
131
|
+
- lib/generators/blacklight/sitemaps/templates/sitemap_controller.rb
|
132
|
+
- lib/generators/blacklight/sitemaps/templates/solrconfig.xml
|
133
|
+
- lib/tasks/blacklight/sitemaps_tasks.rake
|
134
|
+
homepage: https://github.com/cdmo/blacklight-sitemaps
|
135
|
+
licenses:
|
136
|
+
- Apache-2.0
|
137
|
+
metadata: {}
|
138
|
+
post_install_message:
|
139
|
+
rdoc_options: []
|
140
|
+
require_paths:
|
141
|
+
- lib
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
requirements: []
|
153
|
+
rubygems_version: 3.1.1
|
154
|
+
signing_key:
|
155
|
+
specification_version: 4
|
156
|
+
summary: Sitemaps for Solr in Blacklight
|
157
|
+
test_files: []
|