Skip to content

Commit

Permalink
enhance documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nosvalds committed Nov 1, 2022
1 parent 3ecbcf2 commit 57239a3
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# datastore-solr-configs

This repo contains the [Solr Configsets](https://solr.apache.org/guide/solr/latest/configuration-guide/config-sets.html) for the IATI Datastore

## Getting started

git clone <url> --recurse-submodules

https://git-scm.com/book/en/v2/Git-Tools-Submodules

## Convert Schema to Solrconfig / Make updates to a Config

Make a branch

Edit templates if necessary:

- Solr Schema - `schema-converter/templates/{collection}/managed-schema-template.xml`
Expand All @@ -30,19 +36,25 @@ Then zip all configs
```bash
cd zips
./zipConfigs.sh
# provide version number when prompted
# provide version number when prompted - see Versioning info below to decide how to version
```

Diff updates, commit to git
Diff updates, commit to branch, make a PR, test, then merge.

## Sync Configset to Solr

The below details are all Solr implementation specific, which is why we link to the IATI internal wiki for some steps.

### Versioning

If the change requires a Re-Index, increment the version by 1. (e.g. {collection}_configset_8 to {collection}_configset_9)

If the change does not require a Re-Index and you would like to load into the existing Configset Used by your active collections, add a -N to the version. (e.g. {collection}_configset_8-1, {collection}_configset_8-2)

Only bump a version if there are changes to the configset. So the version numbers for each collection will not be totally the same.

See this guide to determine if you need a ReIndex with the change: https://solr.apache.org/guide/solr/latest/indexing-guide/reindexing.html#changes-that-require-reindex

### Create or Update a configset in Solr

Use zips from above, or zip a single config for testing
Expand All @@ -51,17 +63,11 @@ Use zips from above, or zip a single config for testing
(cd configsets/activity/conf && zip -r - *) > activity_configset_V.zip
```

If the change requires [reindexing](https://solr.apache.org/guide/8_10/reindexing.html), please follow our guide on the [wiki](https://github.com/IATI/IATI-Internal-Wiki/blob/main/IATI-Unified-Infra/Solr.md). You will need to create new configsets in Solr
#### ReIndexing Required

```bash
curl -X PUT --header "Content-Type:application/octet-stream" --data-binary @<configsetname>.zip
"<solrHost>/api/cluster/configs/<configsetname>"
```
If the change requires [reindexing](https://solr.apache.org/guide/solr/latest/indexing-guide/reindexing.html), please follow the guide on the [wiki](https://github.com/IATI/IATI-Internal-Wiki/blob/main/IATI-Unified-Infra/Solr.md).

If the change does not require reindexing, make sure to update the config used by the active Collection (with the correct `configsetname`).

Then RELOAD the Collection
#### No ReIndexing - In Place swap

```bash
curl --location --request GET '<solrHost>/api/solr/admin/collections?action=RELOAD&name=<collectionName>'
```
If the change does not require reindexing, follow the guide on the [wiki](https://github.com/IATI/IATI-Internal-Wiki/blob/main/IATI-Unified-Infra/Solr.md#updating-solr-config-in-place-no-re-indexing-required) for that process

0 comments on commit 57239a3

Please sign in to comment.