Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Apache Ant/Reindex a Collection

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Motivation You want a simple ant task that will reindex a collection. Method We will us the ant task that will call an XQuery that has the reindex() command in it. Because there is no ant task that does this we will use the xquery task to execute a remote XQuery that performs this task. Here is a link to the ant task to run an XQuery http://exist-db.org/ant-tasks.html#N1041F Call a remote XQuery by file name <target name="reindex-collection"> <xdb:xquery user="${user}" password="${password}" uri="${test-server}$(collection)" query="reindex.xq" outputproperty="result"> </xdb:xquery> <echo message="Result = ${result}"/> </target> Supply the Body of an XQuery <target name="inline-query"> <xdb:xquery uri="${test-server}/db" user="${user}" password="${password}" outputproperty="result"> reindex('/db/mycollection') </xdb:xquery> <!-- note, this only returns a SINGLE line --> <echo message="Result = ${result}"/> </target>