Skip to content

Commit 14ad208

Browse files
committed
update repository abstraction
1 parent 6ec7814 commit 14ad208

File tree

28 files changed

+1936
-252
lines changed

28 files changed

+1936
-252
lines changed

docker/compose/solr/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# pycsw with SOLR backend
2+
3+
## metno work
4+
5+
@epifiano and the team at metno did amazing work in their implementation of pycsw, this work is inspired by their work
6+
7+
- https://github.com/epifanio/adc-pycsw
8+
- https://github.com/geopython/pygeofilter/blob/main/.github/workflows/main.yml#L41
9+
- https://github.com/geopython/pygeofilter/blob/main/tests/backends/solr/test_evaluate.py
10+
- https://github.com/magnarem/metsis-solr-configset
11+
12+
## security
13+
14+
Enable security in security.json, see also [solr documentation](https://solr.apache.org/guide/solr/latest/deployment-guide/authentication-and-authorization-plugins.html#using-security-json-with-solr)
15+
16+
## SOLR is used in QWC
17+
18+
Some links from their docs
19+
20+
- https://github.com/qwc-services/qwc-fulltext-search-service/?tab=readme-ov-file#solr-backend
21+
22+
## paradedb
23+
24+
paradedb is a plugin to postgres introducing FTS, including facets, so maybe no solr needed?
25+
26+
- https://github.com/paradedb/paradedb
27+
- https://github.com/qwc-services/qwc-base-db/pull/10
28+
- https://docs.paradedb.com/documentation/indexing/create_index
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# =================================================================
2+
#
3+
# Authors: Ricardo Garcia Silva <[email protected]>
4+
# Authors: Tom Kralidis <[email protected]>
5+
#
6+
# Copyright (c) 2017 Ricardo Garcia Silva
7+
# Copyright (c) 2025 Tom Kralidis
8+
#
9+
# Permission is hereby granted, free of charge, to any person
10+
# obtaining a copy of this software and associated documentation
11+
# files (the "Software"), to deal in the Software without
12+
# restriction, including without limitation the rights to use,
13+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
# copies of the Software, and to permit persons to whom the
15+
# Software is furnished to do so, subject to the following
16+
# conditions:
17+
#
18+
# The above copyright notice and this permission notice shall be
19+
# included in all copies or substantial portions of the Software.
20+
#
21+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28+
# OTHER DEALINGS IN THE SOFTWARE.
29+
#
30+
# =================================================================
31+
#
32+
#
33+
# This docker compose file demos how to use the pycsw docker image with a
34+
# PostgreSQL/PostGIS database.
35+
#
36+
# docker compose usage:
37+
#
38+
# docker compose up
39+
#
40+
# docker stack (in a docker swarm):
41+
#
42+
# PYCSW_DOCKER_IMAGE=2.1-dev docker stack deploy --compose-file docker-compose.yml pycsw
43+
#
44+
45+
services:
46+
solr:
47+
container_name: solr
48+
image: solr:slim
49+
healthcheck:
50+
test: >-
51+
curl -s -A 'healthcheck' http://localhost:8983/solr/gettingstarted/admin/ping?wt=json \
52+
| grep -q '"status":"OK"'
53+
start_period: 15s
54+
interval: 10s
55+
timeout: 5s
56+
retries: 3
57+
volumes:
58+
- solr-data:/var/solr
59+
ports:
60+
- 8983:8983
61+
networks:
62+
- pycsw-net
63+
command:
64+
- solr-precreate
65+
- gettingstarted
66+
pycsw:
67+
container_name: pycsw
68+
depends_on:
69+
solr:
70+
condition: service_healthy
71+
build: ../../..
72+
environment:
73+
PYCSW_SERVER_URL: http://localhost:8000
74+
ports:
75+
- 8000:8000
76+
volumes:
77+
- ./pycsw-solr.yml:/etc/pycsw/pycsw.yml
78+
- ./solr_helper.py:/usr/local/lib/python3.10/site-packages/pycsw/plugins/repository/solr_helper.py
79+
- ./solr_pycsw.py:/usr/local/lib/python3.10/site-packages/pycsw/plugins/repository/solr_pycsw.py
80+
networks:
81+
- pycsw-net
82+
83+
networks:
84+
pycsw-net:
85+
86+
volumes:
87+
solr-data:

docker/compose/solr/pycsw-solr.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# =================================================================
2+
#
3+
# Authors: Tom Kralidis <[email protected]>
4+
# Ricardo Garcia Silva <[email protected]>
5+
#
6+
# Copyright (c) 2024 Tom Kralidis
7+
# Copyright (c) 2017 Ricardo Garcia Silva
8+
#
9+
# Permission is hereby granted, free of charge, to any person
10+
# obtaining a copy of this software and associated documentation
11+
# files (the "Software"), to deal in the Software without
12+
# restriction, including without limitation the rights to use,
13+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
# copies of the Software, and to permit persons to whom the
15+
# Software is furnished to do so, subject to the following
16+
# conditions:
17+
#
18+
# The above copyright notice and this permission notice shall be
19+
# included in all copies or substantial portions of the Software.
20+
#
21+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28+
# OTHER DEALINGS IN THE SOFTWARE.
29+
#
30+
# =================================================================
31+
32+
server:
33+
url: ${PYCSW_SERVER_URL}
34+
mimetype: application/xml; charset=UTF-8
35+
encoding: UTF-8
36+
language: en-US
37+
maxrecords: 10
38+
timeout: 30
39+
#ogc_schemas_location: http://foo
40+
#pretty_print: true
41+
gzip_compresslevel: 9
42+
#domainquerytype: range
43+
#domaincounts: true
44+
#spatial_ranking: true
45+
#workers=2
46+
47+
logging:
48+
level: DEBUG
49+
#logfile: /tmp/pycsw.log
50+
51+
profiles:
52+
- apiso
53+
54+
federatedcatalogues:
55+
- http://catalog.data.gov/csw
56+
57+
manager:
58+
transactions: false
59+
allowed_ips:
60+
- 127.0.0.1
61+
# csw_harvest_pagesize: 10
62+
63+
metadata:
64+
identification:
65+
title: pycsw Geospatial Catalogue
66+
description: pycsw is an OARec and OGC CSW server implementation written in Python
67+
keywords:
68+
- catalogue
69+
- discovery
70+
- metadata
71+
keywords_type: theme
72+
fees: None
73+
accessconstraints: None
74+
terms_of_service: https://creativecommons.org/licenses/by/4.0
75+
url: https://example.org
76+
license:
77+
name: CC-BY 4.0 license
78+
url: https://creativecommons.org/licenses/by/4.0
79+
provider:
80+
name: Organization Name
81+
url: https://pycsw.org
82+
contact:
83+
name: Lastname, Firstname
84+
position: Position Title
85+
address: Mailing Address
86+
city: City
87+
stateorprovince: Administrative Area
88+
postalcode: Zip or Postal Code
89+
country: Country
90+
phone: +xx-xxx-xxx-xxxx
91+
fax: +xx-xxx-xxx-xxxx
92+
93+
url: Contact URL
94+
hours: Mo-Fr 08:00-17:00
95+
instructions: During hours of service. Off on weekends.
96+
role: pointOfContact
97+
98+
inspire:
99+
enabled: true
100+
languages_supported:
101+
- eng
102+
default_language: eng
103+
date: YYYY-MM-DD
104+
gemet_keywords:
105+
- Utility and governmental services
106+
conformity_service: notEvaluated
107+
contact_name: Organization Name
108+
contact_email: Email Address
109+
temp_extent:
110+
begin: YYYY-MM-DD
111+
end: YYYY-MM-DD
112+
113+
repository:
114+
database: None
115+
table: None
116+
source: pycsw.plugins.repository.solr_pycsw.SOLRPYCSWRepository
117+
filter: https://pycsw.net

0 commit comments

Comments
 (0)