Skip to content

Commit

Permalink
Add solr multi core config for mocha testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-bulgaris-qcif committed May 27, 2024
1 parent 897fac6 commit ae1e3bd
Show file tree
Hide file tree
Showing 6 changed files with 1,068 additions and 224 deletions.
222 changes: 0 additions & 222 deletions config/solr.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,228 +225,6 @@ module.exports.solr = {
stored: false,
required: false
}
},
dataRecordSearchCore: {
options: {
host: 'solr',
port: '8983',
core: 'dataRecordSolrCore'
},
schema: {
'add-field': [
{
name: "full_text",
type: "text_general",
indexed: true,
stored: false,
multiValued: true
},
{
name: "title",
type: "text_general",
indexed: true,
stored: true,
multiValued: false
},
{
name: "description",
type: "text_general",
indexed: true,
stored: true,
multiValued: false
},
{
name: "grant_number_name",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "finalKeywords",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "text_title",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "text_description",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "authorization_view",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "authorization_edit",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "authorization_viewPending",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "authorization_editPending",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "redboxOid",
type: "text_general",
indexed: true,
stored: true,
multiValued: false
},
{
name: "authorization_viewRoles",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "authorization_editRoles",
type: "text_general",
indexed: true,
stored: true,
multiValued: true
},
{
name: "metaMetadata_brandId",
type: "text_general",
indexed: true,
stored: true,
multiValued: false
},
{
name: "metaMetadata_type",
type: "text_general",
indexed: true,
stored: true,
multiValued: false
},
{
name: "workflow_stageLabel",
type: "text_general",
indexed: true,
stored: true,
multiValued: false
},
{
name: "workflow_step",
type: "text_general",
indexed: true,
stored: true,
multiValued: false
}
],
'add-dynamic-field': [
{
name: "date_*",
type: "pdate",
indexed: true,
stored: true
}
],
'add-copy-field': [
{
source: "*",
dest: "full_text"
},
{
source: 'title',
dest: 'text_title'
},
{
source: 'description',
dest: 'text_description'
}
]
},
// note that the original object will be cloned
// all 'source' values will refer to the path in the original object
preIndex: {
// remove the 'metadata' nested key
move: [
{
source: 'metadata',
dest: '' // the root object when empty, otherwise a path value used in _.set()
}
],
copy: [
{
source: 'metaMetadata.createdOn',
dest: 'date_object_created'
},
{
source: 'lastSaveDate',
dest: 'date_object_modified'
}
],
flatten: {
// uncomment below to pass in specific options when flattening using https://www.npmjs.com/package/flat
// options: {
//
// },
special: [
{
source: 'workflow',
options: {
safe: false,
delimiter: '_'
}
},
{
source: 'authorization',
options: {
safe: true,
delimiter: '_'
}
},
{
source: 'metaMetadata',
options: {
safe: false,
delimiter: '_'
}
},
{
source: 'metadata.finalKeywords',
dest: 'finalKeywords',
options: {
safe: true
}
}
]
}
},
initSchemaFlag: {
name: 'schema_initialised',
type: 'text_general',
stored: false,
required: false
}
}
}
};
5 changes: 3 additions & 2 deletions support/development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ services:
- "8983"
ports:
- "8983:8983"
volumes:
- "./solr.in.sh:/etc/default/solr.in.sh"
# Example of pre create additional solr cores that needs to be coupled with correct record type configuration
# volumes:
# - "../integration-testing/solr.in.sh:/etc/default/solr.in.sh"
networks:
main:
aliases:
Expand Down
4 changes: 4 additions & 0 deletions support/integration-testing/docker-compose.mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
volumes:
- "../../:/opt/redbox-portal"
- "./.tmp/attachments:/attachments"
- "./recordtype-solr-multi-core-example.js:/opt/redbox-portal/config/recordtype.js"
- "./solr-multi-core-example.js:/opt/redbox-portal/config/solr.js"
expose:
- "1500"
environment:
Expand Down Expand Up @@ -56,6 +58,8 @@ services:
- "8983"
ports:
- "8983:8983"
volumes:
- "./solr.in.sh:/etc/default/solr.in.sh"
networks:
main:
aliases:
Expand Down
Loading

0 comments on commit ae1e3bd

Please sign in to comment.