marklogic ml-gradle configuration for super databases

164 Views Asked by At

I currently have a super / sub database setup and would like to know the best way to deploy a fresh install via ml-gradle 2.7.0.

I have gotten it to work by removing the following file from my config directory for the first pass mlDeploy.

{
  "database-name" : "my-documents",
  "subdatabase" : [ {
    "database-name" : "my-seconddb"
  }, {
    "database-name" : "my-thirddb"
  } ]
}

After all of the databases are established for the first time, adding that back to the directory and re-running mlDeploy corrects the setup.

Additionally, I would like to keep the indexing settings for all three databases in one file if possible. Is there currently any way to do that?

Thank you for this time saving tool. So far it is much easier to use than Roxy.

Simplest configuration:

src/main/ml-config/databases/1-my-firstsub.json
{
  "database-name" : "my-firstsub"
}

src/main/ml-config/databases/2-my-nextsub.json
{
  "database-name" : "my-nextsub"
}

src/main/ml-config/databases/6-my-documents.json
{
  "database-name" : "my-documents",
  "subdatabase" : [ {
    "database-name" : "my-firstsub"
  }, {
    "database-name" : "my-nextsub"
  } ]
}
1

There are 1 best solutions below

4
On BEST ANSWER

It's not yet possible to store multiple databases in one file. I've tried to avoid inventing new schemas beyond what the Manage API defines, so it's one database per file.

You can control the order in which each database is created by the database filename - e.g. if you need my-seconddb and my-thirddb created before my-documents, use filenames of "1-my-seconddb.json", "2-my-thirddb.json", "and "3-my-documents.json". That should allow for my-documents to have subdatabases in it, as the other databases will have already been created.