Skip to content
Snippets Groups Projects
Commit ab334b0b authored by Mike Lynch's avatar Mike Lynch
Browse files

Sorted out a few more bugs, removed a lot of debugging messages

parent 9134db14
Branches
No related merge requests found
......@@ -212,9 +212,16 @@ async function purgeSolr() {
console.log("All solr documents deleted.");
return true
} catch(e) {
console.log("Solr error");
console.log(e.response.status);
return false;
if( e.response ) {
console.log("Solr error");
console.log(e.response.status);
return false;
} else {
console.log("General error");
console.log(e);
process.exit(-1);
}
}
}
......@@ -245,7 +252,7 @@ async function loadFromOcfl(repoPath) {
jsonld: json
});
} else {
console.log(`No ${catalogFilename} found in ${object['path']}`);
// console.log(`No ${catalogFilename} found in ${object['path']}`);
}
}
}
......@@ -378,7 +385,6 @@ async function main () {
await updateSchema(solrSchema, configJson['schema']);
}
return;
const records = await loadFromOcfl(sourcePath);
await commitBatches(records);
......
......@@ -223,7 +223,6 @@ Types with errors: ${this.errors.join(', ')}`);
var types = this.crate.utils.asArray(item['@type']);
// Look through types in order
for (let type of Object.keys(cfTypes)) {
if (types.includes(type)) {
// get config for this type of item
......@@ -243,6 +242,8 @@ Types with errors: ${this.errors.join(', ')}`);
// }
solrDocument[type].push(solr);
} else {
//console.log("...not indexing, filter failed");
}
}
}
......@@ -263,6 +264,7 @@ Types with errors: ${this.errors.join(', ')}`);
if( ! fieldcf['skip'] ) {
// resolve lookups
if( fieldcf['resolve'] ) {
console.log(`Resolving values for ${field}: ${JSON.stringify(value)}`);
solr[field] = this.resolveValues(fieldcf['resolve'], value);
const vals = this.crate.utils.asArray(solr[field]);
solr[`${field}_id`] = [];
......@@ -272,7 +274,7 @@ Types with errors: ${this.errors.join(', ')}`);
solr[`${field}_id`].push(value["@id"]);
}
catch (e) {
//console.log("ERROR", e.message, val)
console.log("Resolution error: ", e.message, val)
}
}
} else {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment