Skip to content

Commit 1626d70

Browse files
authored
Solr fulltext indexing (#204)
* Add collective.solr using solr version and config provided there * pre-commit reformatting of upstream checkin * Remove intermediate solr/config directory * Keep results-listing working with collective.solr. - Backport the index fields from the old deployment. - No test changes, because no test coverage on this view at all. This is just a dirty MVP checkpoint. It works but the schema needs cleaning up. * Activate fulltext PDF solr search Also: provide upgrade, adjust tests * Move solr reindex to a separate upgrade step * Load collective.solr zcml in zcml * Remove migration notes from README * Document Solr gotchas * Reference upstream ticket on Tika integration * Fix build regression introduced in dfddb0a * Use getattr instead of hasattr * Up Solr to 9.9.0 * Move test solr to a different port Refs syslabcom/scrum#3974 * Temporary workaround for cross-site Unauthorized * Move solr config into ./etc/ to avoid confusion * Update README * Change CI pre-commit runner
1 parent 36eacf6 commit 1626d70

File tree

24 files changed

+4792
-33
lines changed

24 files changed

+4792
-33
lines changed

.github/workflows/plone-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
restore-keys: |
3131
${{ runner.os }}-cache-
3232
- name: Code Analysis
33-
uses: pre-commit/action@v3.0.1
33+
uses: pre-commit-ci/lite-action@v1.1.0
3434
if: ${{ matrix.config[1] == '3.13' }}
3535
- name: Install dependencies
3636
run: |

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Changelog
1717
- Update the pre-commit linters [gyst]
1818
- Don't error out on main nav on a clean install [gyst]
1919
- Upgrade ftw.upgrade to the SLC patched version [gyst]
20+
- Add collective.solr and make the eea.facetednavigation view compatible with that [gyst]
21+
- Activate fulltext PDF solr search, provide upgrade, adjust tests [gyst]
2022
- Bugfix PublicationsViewlet for the Plone upgrade [gyst]
2123
- Add parameter -asxhtml to tidy to fix pdf generation of html reviews [pilz]
2224
- Fix the ``sehepunkte-import`` view

README.rst

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,20 @@ We need some system packages to be available for this package to be fully functi
1717
- poppler_utils (pdf)
1818
- html-tidy (cleans up the html that will be converted to pdf)
1919

20+
Solr: cave canem
21+
================
2022

21-
Migration
22-
=========
23+
This package now works with collective.solr and performs fulltext indexing of PDF documents.
2324

24-
Read `Notes on speed and large migrations <https://github.com/collective/collective.exportimport#notes-on-speed-and-large-migrations>`_ in the collective.exportimport README.
25+
There are a few gotchas:
2526

26-
Then decide if you want to do an export from Plone 4 and only set blob paths.
27-
If so, set the `COLLECTIVE_EXPORTIMPORT_BLOB_HOME` variable on import.
27+
- Fulltext indexing of PDFs on reviews works fine, but fulltext indexing of standalone files will error out with a default Solr install.
28+
To get it to work properly, your Solr needs to be started up with special environment variables::
2829

29-
Also disable the recensio event subscribers which would generate PDFs from already generated content.
30-
To do this, set `RECENSIO_DISABLE_SUBSCRIBERS=true`.
30+
SOLR_ENABLE_REMOTE_STREAMING=true SOLR_ENABLE_STREAM_BODY=true SOLR_OPTS="-Dsolr.allowPaths=${instance:blob-storage}"
3131

32-
After successful migration import the page pictures, which were not in the Recensio Archetypes schema in Plone 4 and therefore not exported.
33-
The blob home environment variable must be set to import the page pictures.
32+
For more background, see https://github.com/collective/collective.solr/issues/385
3433

35-
`http://localhost:8080/recensio/@@import-page-pictures`
34+
- The recensio.plone buildout provided Solr is to be used only for testing; it will be nuked on test runs.
3635

37-
38-
Order of import:
39-
40-
1) Create fresh Plone instance "recensio"
41-
2) Apply profile `recensio.plone:default`
42-
43-
3) Import users (< 5m): http://localhost:8080/recensio/@@import_members
44-
4) Import content: (3.5-4h): http://localhost:8080/recensio/@@import_content
45-
5) Import relations: (5 minutes): http://localhost:8080/recensio/@@import_relations
46-
6) Import translations (0): http://localhost:8080/recensio/@@import_translations
47-
7) Import local roles (< 5m): http://localhost:8080/recensio/@@import_localroles
48-
8) Import default pages (< 5m): http://localhost:8080/recensio/@@import_defaultpages
49-
9) Import ordering (~ 20m): http://localhost:8080/recensio/@@import_ordering
50-
10) Import portlets (< 5m): http://localhost:8080/recensio/@@import_portlets
51-
11) Reset dates (< 5m): http://localhost:8080/recensio/@@reset_dates
52-
12) Fix collections (0m): http://localhost:8080/recensio/@@fix_collection_queries
53-
13) Fix html (< 5m): http://localhost:8080/recensio/@@fix_html
36+
Recensio.buildout provides both a testing solr (via buildout, on :8984) and a development solr (via Makefile, on :8983) to effect this split.

buildout.cfg

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ find-links +=
77
parts =
88
test
99
createcoverage
10+
solr
11+
1012
show-picked-versions = true
1113
allow-picked-versions = true
1214
download-cache = downloads
@@ -23,23 +25,34 @@ eggs =
2325
Pillow
2426
recensio.plone [test]
2527

26-
2728
[createcoverage]
2829
recipe = zc.recipe.egg
2930
eggs = createcoverage
3031

32+
[solr]
33+
recipe = kitconcept.recipe.solr
34+
src = https://www.apache.org/dyn/closer.lua/solr/solr/9.9.0/solr-9.9.0.tgz?action=download
35+
port = 8984
36+
solr-config = etc/solr
37+
38+
3139
[sources]
3240
guess-language = git https://github.com/syslabcom/guess-language.git
3341

3442
[versions]
3543
createcoverage = 1.5
3644
path.py = 12.5.0
3745
z3c-jbot = 3.1
46+
kitconcept.recipe.solr = 1.0.0a5
3847

3948
# Required by:
4049
# ftw.upgrade==3.4.0a3+slc0
4150
argcomplete = 3.6.2
4251

52+
# Required by:
53+
# recensio.plone==2.0.0.dev0
54+
collective.solr = 9.4.0
55+
4356
# Required by:
4457
# recensio.plone==2.0.0.dev0
4558
collective.vdexvocabulary = 0.3
@@ -52,6 +65,10 @@ collective.z3cform.datagridfield = 3.0.4
5265
# recensio.plone==2.0.0.dev0
5366
eea.facetednavigation = 16.4
5467

68+
# Required by:
69+
# kitconcept.recipe.solr==1.0.0a5
70+
hexagonit.recipe.download = 1.7.1
71+
5572
# Required by:
5673
# recensio.plone==2.0.0.dev0
5774
ftw.upgrade = 3.4.0a3+slc0

0 commit comments

Comments
 (0)