The immediate problem is that INPUT_DIRECTORY_URI conflicts with INPUT_QUERY. XQSync tries INPUT_DIRECTORY_URI first, so INPUT_QUERY is not used. There is some documentation on this, though no doubt it could be improved:
http://marklogic.github.com/xqsync/ > By default, every document in the input database will be transferred. To > change this behavior, use one of the related properties: > • INPUT_COLLECTION_URI > • INPUT_DIRECTORY_URI > • INPUT_DOCUMENT_URIS > • INPUT_QUERY So I would write: INPUT_QUERY=xdmp:directory('/', 'infinity')/xdmp:node-uri(.) Or this will be faster if the URI lexicon is available: INPUT_QUERY=cts:uris((), (), cts:directory-query('/', 'infinity')) Also, INPUT_QUERY works best if you put it into a property file. Otherwise you are at the mercy of shell expansion, which may do unexpected things. When I run that command-line in bash, for example, java tries to treat 'in' from INPUT_QUERY as a classname, resulting in java.lang.NoClassDefFoundError. -- Mike On 9 Feb 2012, at 08:32 , Murray, Gregory wrote: > I'm attempting to use the INPUT_QUERY option for xqsync to exclude certain > documents from the sync. Starting from the simplest possible case and > following the example from the xqsync documentation, here's my script: > > java \ > -cp xqsync.jar:xcc.jar:xstream.jar:xpp3.jar \ > -Dfile.encoding=UTF-8 \ > -DINPUT_CONNECTION_STRING=xcc://me:[email protected]:8028 \ > -DINPUT_DIRECTORY_URI=/a/ab/abc \ > -DINPUT_QUERY="for $i in doc() return ()" \ > -DOUTPUT_CONNECTION_STRING=xcc://me:[email protected]:8035 \ > com.marklogic.ps.xqsync.XQSync > > In this example, I expected all documents to be excluded, since I'm always > returning an empty sequence instead of a uri. Instead, all documents get > synced. Any ideas? > > Thanks, > Greg > > Gregory Murray > Digital Library Application Developer > Princeton Theological Seminary > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
