From eecca8ef748ceea78cee6b67f100e0c5ad49a40a Mon Sep 17 00:00:00 2001 From: Mike Lynch <mike@mikelynch.org> Date: Wed, 13 Nov 2019 11:18:42 +1100 Subject: [PATCH] Now indexes the original dataset licence as licenceOriginal, as well as the mapped licence --- commit-to-solr.js | 2 ++ fields.json | 4 ++++ lib/CatalogSolr.js | 1 + 3 files changed, 7 insertions(+) mode change 100644 => 100755 commit-to-solr.js diff --git a/commit-to-solr.js b/commit-to-solr.js old mode 100644 new mode 100755 index 9fba5de..e8a4b80 --- a/commit-to-solr.js +++ b/commit-to-solr.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const axios = require('axios'); const _ = require('lodash'); const CatalogSolr = require('./lib/CatalogSolr'); diff --git a/fields.json b/fields.json index e305e94..bb19096 100644 --- a/fields.json +++ b/fields.json @@ -28,6 +28,10 @@ "facet": true }, + "licenseOriginal": { + "multi": true + }, + "author": { "resolve": "multi", "facet": true diff --git a/lib/CatalogSolr.js b/lib/CatalogSolr.js index ad90d92..4fed181 100644 --- a/lib/CatalogSolr.js +++ b/lib/CatalogSolr.js @@ -190,6 +190,7 @@ Types with errors: ${this.errors.join(', ')}`); } } + rootItem['licenseOriginal'] = rootItem['license']; rootItem['license'] = this.mapLicenses(rootItem['license']); const rootSolr = this.mapItem(cfBase, datasetCf, 'Dataset', rootItem); const solrDocument = { 'Dataset': [ rootSolr ] }; -- GitLab