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() |
public static void main(String[] args) throws IOException, ClassNotFoundException
IOException - 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-2015 MarkLogic Corporation.