public class GenerateIndexConfig extends Object
Generates a MarkLogic index configuration file in JSON format describing the indexes required by the annotations on the specific classes. The output can be used by an administrator to create indexes in the database using the Management REST API.
WARNING! Applying this generated index file via management API will overwrite existing indexes! Only use this as-is if there are no other indexes on your database that you want to keep. To add these indexes to other indexes please get the configuration for existing indexes from the management API and add these to that file before applying.
Usage example:
java com.marklogic.client.pojo.util.GenerateIndexConfig
-classes "com.marklogic.client.test.City com.marklogic.client.test.Country"
-file cityIndexes.json
curl -i --digest --user admin:admin \
-H 'Content-Type: application/json' \
-d '@cityIndexes.json' \
-X PUT 'http://localhost:8002/manage/LATEST/databases/java-unittest/properties'
| Constructor and Description |
|---|
GenerateIndexConfig() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Reads the annotations from the specified classes and generates MarkLogic index configurations specified by the annotations.
|
public static void main(String[] args) throws IOException, ClassNotFoundException
Reads the annotations from the specified classes and generates MarkLogic index configurations specified by the annotations. Accepts the following options: -classes: a space-separated list of java pojo classes visible on the classpath -file: a file path to write with the output (otherwise uses standard out)
args - an array of the above documented options followed directly by the value for that optionIOException - if an error occurs reading the classes or writing the outputIllegalStateException - if errors are found in your annotationsClassNotFoundException - if the classes are not found on the classpathCopyright © 2013-2017 MarkLogic Corporation.