Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.7 #348

Merged
merged 6 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Create solr8 docker instance for testing
Use namematching service for name lookup on conservation lists and vernacular lists #346
Handle duplicate common names in lists
Handle aliases for common name status
  • Loading branch information
charvolant committed May 23, 2022
commit 9f543aa7eca6bd5faa9eb712af4140c1dc24f02e
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}
}

version "1.6-SNAPSHOT"
version "1.7-SNAPSHOT"
group "au.org.ala"

apply plugin:"eclipse"
Expand Down
20 changes: 17 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,31 @@ debugging
## Solr

The solr image contains a solr server with pre-configred `bie` and `bie-offline` cores.
To build a solr6 image for use with the bie-index run, from this directory
To build a solr8 image for use with the bie-index run, from this directory

```shell
docker build solr6 -t bie-solr:v1
docker build solr8 -t bie-solr:v2
```

To run the resulting image in a fresh container, use

```shell
docker run -p 8983:8983 bie-solr:v1
docker run -p 8983:8983 bie-solr:v2
```

You will then need to add the cores.
Go to http:https://localhost:8983 and choose the cores item.
Click on add core and set the following:

Parameter | Value (bie) | Value (bie-offline)
--- | --- | ---
name | bie | bie-offline
instanceDir | /opt/solr/server/solr/bie | /opt/solr/server/solr/bie-offline
dataDir | /opt/solr/server/solr/bie/data | /opt/solr/server/solr/bie-offline/data
config | solrconfig.xml | solrconfig.xml
schema | schema.xml | schema.xml

(You may need to do this twice; no idea why.)

Set the solr connections in the configuration to
`http:https://localhost:8983/solr/bie` and `http:https://localhost:8983/solr/bie-offline`
15 changes: 15 additions & 0 deletions docker/solr8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM solr:8.1
USER solr:solr
WORKDIR /var/solr/data
COPY solr.xml solr.xml
COPY zoo.cfg zoo.cfg
#COPY --chown=solr:solr lib /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/
RUN mkdir -p bie bie/conf bie/data bie/suggest-infix
COPY conf bie/conf
COPY bie.core.properties bie/core.properties
RUN mkdir -p bie-offline bie-offline/conf bie-offline/data bie-offline/suggest-infix
COPY conf bie-offline/conf
COPY bie-offline.core.properties bie-offline/core.properties
COPY solr.in.sh /etc/default/solr.in.sh


4 changes: 4 additions & 0 deletions docker/solr8/bie-offline.core.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config=solrconfig.xml
name=bie-offline
dataDir=data
schema=schema.xml
4 changes: 4 additions & 0 deletions docker/solr8/bie.core.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config=solrconfig.xml
name=bie
dataDir=data
schema=schema.xml
24 changes: 24 additions & 0 deletions docker/solr8/conf/admin-extra.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http:https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- The content of this page will be statically included into the top-
right box of the cores overview page. Uncomment this as an example to
see there the content will show up.

<img src="img/ico/construction.png"> This line will appear at the top-
right box on collection1's Overview
-->
25 changes: 25 additions & 0 deletions docker/solr8/conf/admin-extra.menu-bottom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http:https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- admin-extra.menu-bottom.html -->
<!--
<li>
<a href="#" style="background-image: url(img/ico/construction.png);">
LAST ITEM
</a>
</li>
-->
25 changes: 25 additions & 0 deletions docker/solr8/conf/admin-extra.menu-top.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http:https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- admin-extra.menu-top.html -->
<!--
<li>
<a href="#" style="background-image: url(img/ico/construction.png);">
FIRST ITEM
</a>
</li>
-->
Empty file.
68 changes: 68 additions & 0 deletions docker/solr8/conf/data-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<dataConfig>
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql:https://localhost/portal" user="root" password="" batchSize="-1"/>
<document>
<entity name="occurrence" query="SELECT oc.id, oc.data_provider_id, dp.name data_provider, oc.data_resource_id, dr.name data_resource,
oc.institution_code_id, ic.code institution_code, ic.name institution_code_name, ic.lsid institution_code_lsid,
oc.collection_code_id, cc.code collection_code, oc.catalogue_number_id, cn.code catalogue_number,
tc.guid taxon_concept_lsid, tn.canonical taxon_name, tn.author, tc.rank rank_id, rnk.name rank,
ror.scientific_name raw_taxon_name, ror.author raw_author, oc.iso_country_code country_code,
kdc.guid kingdom_lsid, kdn.canonical kingdom, phc.guid phylum_lsid, phn.canonical phylum,
clc.guid class_lsid, cln.canonical class, odc.guid order_lsid, odn.canonical `order`,
fmc.guid family_lsid, fmn.canonical family, gnc.guid genus_lsid, gnn.canonical genus, spc.guid species_lsid, spn.canonical species,
oc.latitude, oc.longitude, ror.lat_long_precision, CONCAT_WS(',', oc.latitude, oc.longitude) as lat_long,
oc.cell_id, oc.centi_cell_id, oc.tenmilli_cell_id,
oc.year, oc.month, DATE_FORMAT(oc.occurrence_date,'%Y-%m-%dT%H:%i:%sZ') occurrence_date,
oc.basis_of_record basis_of_record_id, bor.description basis_of_record, ror.basis_of_record raw_basis_of_record,
typ.type_status, lit.it_value identifier_type, idr.identifier identifier_value, ror.identifier_name,
DATE_FORMAT(ror.identification_date,'%Y-%m-%dT%H:%i:%sZ') identifier_date, ror.collector_name collector,
taxonomic_issue, geospatial_issue, other_issue, ror.created created_date, oc.modified modified_date
FROM occurrence_record oc
INNER JOIN raw_occurrence_record ror ON ror.id = oc.id
INNER JOIN data_provider dp ON dp.id = oc.data_provider_id
INNER JOIN data_resource dr ON dr.id = oc.data_resource_id
INNER JOIN institution_code ic ON ic.id = oc.institution_code_id
INNER JOIN collection_code cc ON cc.id = oc.collection_code_id
INNER JOIN catalogue_number cn ON cn.id = oc.catalogue_number_id
INNER JOIN basis_of_record bor ON bor.id = oc.basis_of_record
INNER JOIN taxon_name tn ON tn.id = oc.taxon_name_id
INNER JOIN taxon_concept tc ON tc.id = oc.nub_concept_id
INNER JOIN rank rnk ON rnk.id = tc.rank
LEFT JOIN taxon_concept kdc ON kdc.id = oc.kingdom_concept_id
LEFT JOIN taxon_name kdn ON kdn.id = kdc.taxon_name_id
LEFT JOIN taxon_concept phc ON phc.id = oc.phylum_concept_id
LEFT JOIN taxon_name phn ON phn.id = phc.taxon_name_id
LEFT JOIN taxon_concept clc ON clc.id = oc.class_concept_id
LEFT JOIN taxon_name cln ON cln.id = clc.taxon_name_id
LEFT JOIN taxon_concept odc ON odc.id = oc.order_concept_id
LEFT JOIN taxon_name odn ON odn.id = odc.taxon_name_id
LEFT JOIN taxon_concept fmc ON fmc.id = oc.family_concept_id
LEFT JOIN taxon_name fmn ON fmn.id = fmc.taxon_name_id
LEFT JOIN taxon_concept gnc ON gnc.id = oc.genus_concept_id
LEFT JOIN taxon_name gnn ON gnn.id = gnc.taxon_name_id
LEFT JOIN taxon_concept spc ON spc.id = oc.species_concept_id
LEFT JOIN taxon_name spn ON spn.id = spc.taxon_name_id
LEFT JOIN typification_record typ ON typ.occurrence_id = oc.id
LEFT JOIN identifier_record idr ON idr.occurrence_id = oc.id
LEFT JOIN lookup_identifier_type lit ON lit.it_key = idr.identifier_type
WHERE oc.data_resource_id = 56"> <!-- where data_resource_id = 71 -->
<entity name="state" query="select st.name
FROM geo_mapping gm
LEFT JOIN geo_region st ON st.id = gm.geo_region_id AND st.region_type &lt;= 2
WHERE gm.occurrence_id=${occurrence.id}">
<field column="name" name="state"/>
</entity>
<entity name="biogeographic_region" query="select bgr.name
FROM geo_mapping gm
LEFT JOIN geo_region bgr ON bgr.id = gm.geo_region_id AND bgr.region_type = 2000
WHERE gm.occurrence_id=${occurrence.id}">
<field column="name" name="biogeographic_region"/>
</entity>
<entity name="places" query="select plc.name
FROM geo_mapping gm
LEFT JOIN geo_region plc ON plc.id = gm.geo_region_id AND (plc.region_type &gt;= 3 AND plc.region_type &lt;= 11)
WHERE gm.occurrence_id=${occurrence.id}">
<field column="name" name="places"/>
</entity>
</entity>
</document>
</dataConfig>
36 changes: 36 additions & 0 deletions docker/solr8/conf/elevate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http:https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- If this file is found in the config directory, it will only be
loaded once at startup. If it is found in Solr's data
directory, it will be re-loaded every commit.
-->

<elevate>
<query text="foo bar">
<doc id="1" />
<doc id="2" />
<doc id="3" />
</query>

<query text="ipod">
<doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
<doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
</query>

</elevate>
Loading