Once you know the XQuery to execute, the XCC API is fairly easy to use. Look for Request.newAdHocQuery()
You can see how xmlsh does this here: http://sourceforge.net/p/xmlsh/code/846/tree/extensions/marklogic/src/org/xmlsh/marklogic/query.java There's some helper code involved you wont need ... the basics is just a few lines. If you are not already running a Java program it might be easier to just use xmlsh and the marklogic extension to do this. http://www.xmlsh.org/ModuleMarkLogic The above listing is from the "query" command http://www.xmlsh.org/MarkLogicQuery If you are already running a java program the XCC API is easy to integrate. Another option, which is easier to explain but takes some more setup, is to create a App server and put your xquery in the modules database or folder then expose your query via HTTP. ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected] Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com<http://www.marklogic.com/> From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Monday, August 12, 2013 5:43 PM To: [email protected] Subject: [MarkLogic Dev General] creating indexes progammatically HI all, Can someone suggest me best ways to automate the INDEXes creation on marklogic database? I am trying to make this as a part of deployment process. I am having hard time understanding JAVA XCC api to create indexes programmatically? Or is there any marklogic java api which can take straight forward xquery and execute it on the database. Your ideas are much appreciated. Thanks Praveen
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
