vxquery-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From christ...@apache.org
Subject [1/3] vxquery git commit: [VXQUERY-196][VXQUERY-204][VXQUERY-228] Cleaning up indexing query statements
Date Tue, 11 Jul 2017 17:24:34 GMT
Repository: vxquery
Updated Branches:
  refs/heads/master 37642bee2 -> 4a38f670c


http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java
index 6558274..1d66c4e 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java
@@ -16,7 +16,6 @@
  */
 package org.apache.vxquery.runtime.functions.util;
 
-import java.io.DataInputStream;
 import java.io.DataOutput;
 import java.io.File;
 import java.io.FileInputStream;
@@ -37,7 +36,7 @@ import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
 import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.data.std.util.GrowableArray;
 import org.apache.hyracks.data.std.util.UTF8StringBuilder;
-import org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+import org.apache.hyracks.util.string.UTF8StringUtil;
 import org.apache.vxquery.context.DynamicContext;
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.accessors.TypedPointables;
@@ -485,6 +484,15 @@ public class FunctionHelper {
         return true;
     }
 
+    public static String getStringFromBytes(byte[] bytes) {
+        if (bytes == null) {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        UTF8StringUtil.toString(sb, bytes, 0);
+        return sb.toString();
+    }
+
     public static boolean compareTaggedValues(AbstractValueComparisonOperation aOp, TaggedValuePointable tvp1,
             TaggedValuePointable tvp2, DynamicContext dCtx, TypedPointables tp1, TypedPointables tp2)
             throws SystemException {
@@ -1215,13 +1223,12 @@ public class FunctionHelper {
         System.err.println(" printUTF8String END");
     }
 
-    public static void readInDocFromPointable(UTF8StringPointable stringp, ByteBufferInputStream bbis,
-            DataInputStream di, ArrayBackedValueStorage abvs, IParser parser) throws IOException {
-        readInDocFromString(stringp.toString(), bbis, di, abvs, parser);
+    public static void readInDocFromPointable(UTF8StringPointable stringp, ArrayBackedValueStorage abvs,
+            IParser parser) throws IOException {
+        readInDocFromString(stringp.toString(), abvs, parser);
     }
 
-    public static void readInDocFromString(String fName, ByteBufferInputStream bbis, DataInputStream di,
-            ArrayBackedValueStorage abvs, IParser parser) throws IOException {
+    public static void readInDocFromString(String fName, ArrayBackedValueStorage abvs, IParser parser) throws IOException {
         Reader input;
         if (!fName.contains("hdfs:/")) {
             File file = new File(fName);

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
index 84c8ddf..9e21f53 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
@@ -129,8 +129,6 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
     public SAXContentHandler(boolean attachTypes, ITreeNodeIdProvider nodeIdProvider, IFrameFieldAppender appender,
             List<SequenceType> childSequenceTypes) {
         this(attachTypes, nodeIdProvider, false);
-
-        // Frame writing variables
         this.appender = appender;
         setChildPathSteps(childSequenceTypes);
     }
@@ -297,10 +295,11 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
 
     /**
      * The filter settings here are similar to one in the class linked below.
-     *
+     * 
+     * @throws SAXException
      * @see org.apache.vxquery.runtime.functions.step.NodeTestFilter.java
      */
-    private boolean startElementChildPathStep(String uri, String localName) {
+    private boolean startElementChildPathStep(String uri, String localName) throws SAXException {
         if (subElement != null && depth <= subElement.length) {
             // Check path step if it exists.
             subElement[depth - 1] = true;

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
index 0c252b4..d3d02ae 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
@@ -222,7 +222,7 @@ public class XMLQueryCompiler {
         }
     }
 
-    public void compile(String name, Reader query, CompilerControlBlock ccb, int optimizationLevel)
+    public void compile(String name, Reader query, CompilerControlBlock ccb, int optimizationLevel, List<String> collections)
             throws AlgebricksException, SystemException {
         moduleNode = XMLQueryParser.parse(name, query);
         listener.notifyParseResult(moduleNode);
@@ -230,7 +230,7 @@ public class XMLQueryCompiler {
         pprinter = new LogicalOperatorPrettyPrintVisitor(new AlgebricksAppendable(),
                 new VXQueryLogicalExpressionPrettyPrintVisitor(module.getModuleContext()));
         VXQueryMetadataProvider mdProvider = new VXQueryMetadataProvider(nodeList, ccb.getSourceFileMap(),
-                module.getModuleContext(), this.hdfsConf, nodeControllerInfos);
+                module.getModuleContext(), this.hdfsConf, nodeControllerInfos, collections);
         compiler = cFactory.createCompiler(module.getBody(), mdProvider, 0);
         listener.notifyTranslationResult(module);
         XMLQueryTypeChecker.typeCheckModule(module);

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-core/src/test/java/org/apache/vxquery/indexing/MetaFileUtilTest.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/test/java/org/apache/vxquery/indexing/MetaFileUtilTest.java b/vxquery-core/src/test/java/org/apache/vxquery/indexing/MetaFileUtilTest.java
index 60f39f8..45d553f 100644
--- a/vxquery-core/src/test/java/org/apache/vxquery/indexing/MetaFileUtilTest.java
+++ b/vxquery-core/src/test/java/org/apache/vxquery/indexing/MetaFileUtilTest.java
@@ -23,8 +23,8 @@ import java.util.concurrent.ConcurrentHashMap;
 import javax.xml.bind.JAXBException;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.vxquery.runtime.functions.index.updateIndex.MetaFileUtil;
-import org.apache.vxquery.runtime.functions.index.updateIndex.XmlMetadata;
+import org.apache.vxquery.runtime.functions.index.update.MetaFileUtil;
+import org.apache.vxquery.runtime.functions.index.update.XmlMetadata;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-core/src/test/java/org/apache/vxquery/indexing/TestConstants.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/test/java/org/apache/vxquery/indexing/TestConstants.java b/vxquery-core/src/test/java/org/apache/vxquery/indexing/TestConstants.java
index b79107e..1b3e0b7 100644
--- a/vxquery-core/src/test/java/org/apache/vxquery/indexing/TestConstants.java
+++ b/vxquery-core/src/test/java/org/apache/vxquery/indexing/TestConstants.java
@@ -14,8 +14,6 @@
  */
 package org.apache.vxquery.indexing;
 
-import org.apache.vxquery.runtime.functions.index.updateIndex.XmlMetadata;
-
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
@@ -27,6 +25,8 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.vxquery.runtime.functions.index.update.XmlMetadata;
+
 /**
  * TestConstants and methods which will be used in indexing test cases.
  */

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-core/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java b/vxquery-core/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java
index 7646f97..1ee35a4 100644
--- a/vxquery-core/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java
+++ b/vxquery-core/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java
@@ -142,6 +142,6 @@ public class SimpleXQueryTest {
         XMLQueryCompiler compiler = new XMLQueryCompiler(null, nodeControllerInfos, 65536);
         CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(RootStaticContextImpl.INSTANCE),
                 new ResultSetId(System.nanoTime()), null);
-        compiler.compile(testName, new StringReader(query), ccb, Integer.MAX_VALUE);
+        compiler.compile(testName, new StringReader(query), ccb, Integer.MAX_VALUE, null);
     }
 }

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
index e4ba6eb..fa0a900 100644
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
@@ -14,16 +14,22 @@
  */
 package org.apache.vxquery.xtest;
 
+import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.EnumSet;
+import java.util.List;
 import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.hyracks.api.client.IHyracksClientConnection;
 import org.apache.hyracks.api.client.NodeControllerInfo;
 import org.apache.hyracks.api.comm.IFrame;
@@ -53,13 +59,14 @@ import org.apache.vxquery.xmlquery.query.XMLQueryCompiler;
 
 public class TestRunner {
     private static final Pattern EMBEDDED_SYSERROR_PATTERN = Pattern.compile("(\\p{javaUpperCase}{4}\\d{4})");
-
+    private List<String> collectionList;
     private XTestOptions opts;
     private IHyracksClientConnection hcc;
     private IHyracksDataset hds;
 
     public TestRunner(XTestOptions opts) throws UnknownHostException {
         this.opts = opts;
+        this.collectionList = new ArrayList<String>();
     }
 
     public void open() throws Exception {
@@ -67,8 +74,46 @@ public class TestRunner {
         hds = TestClusterUtil.getDataset();
     }
 
+    protected static TestConfiguration getIndexConfiguration(TestCase testCase) {
+        XTestOptions opts = new XTestOptions();
+        opts.verbose = false;
+        opts.threads = 1;
+        opts.showQuery = true;
+        opts.showResult = true;
+        opts.hdfsConf = "src/test/resources/hadoop/conf";
+        opts.catalog = StringUtils.join(new String[] { "src", "test", "resources", "VXQueryCatalog.xml" },
+                File.separator);
+        TestConfiguration indexConf = new TestConfiguration();
+        indexConf.options = opts;
+        String baseDir = new File(opts.catalog).getParent();
+        try {
+            String root = new File(baseDir).getCanonicalPath();
+            indexConf.testRoot = new File(root + "/./");
+            indexConf.resultOffsetPath = new File(root + "/./ExpectedResults/");
+            indexConf.sourceFileMap = testCase.getSourceFileMap();
+            indexConf.xqueryFileExtension = ".xq";
+            indexConf.xqueryxFileExtension = "xqx";
+            indexConf.xqueryQueryOffsetPath = new File(root + "/./Queries/XQuery/");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return indexConf;
+
+    }
+
     public TestCaseResult run(final TestCase testCase) {
         TestCaseResult res = new TestCaseResult(testCase);
+        TestCase testCaseIndex = new TestCase(getIndexConfiguration(testCase));
+        testCaseIndex.setFolder("Indexing/Partition-1/");
+        testCaseIndex.setName("showIndexes");
+        runQuery(testCaseIndex, res);
+        String[] collections = res.result.split("\n");
+        this.collectionList = Arrays.asList(collections);
+        runQueries(testCase, res);
+        return res;
+    }
+
+    public void runQuery(TestCase testCase, TestCaseResult res) {
         if (opts.verbose) {
             System.err.println("Starting " + testCase.getXQueryDisplayName());
         }
@@ -78,6 +123,7 @@ public class TestRunner {
         try {
             try {
                 if (opts.showQuery) {
+
                     FileInputStream query = new FileInputStream(testCase.getXQueryFile());
                     System.err.println("***Query for " + testCase.getXQueryDisplayName() + ": ");
                     System.err.println(IOUtils.toString(query, "UTF-8"));
@@ -98,7 +144,7 @@ public class TestRunner {
                 CompilerControlBlock ccb = new CompilerControlBlock(
                         new StaticContextImpl(RootStaticContextImpl.INSTANCE),
                         new ResultSetId(testCase.getXQueryDisplayName().hashCode()), testCase.getSourceFileMap());
-                compiler.compile(testCase.getXQueryDisplayName(), in, ccb, opts.optimizationLevel);
+                compiler.compile(testCase.getXQueryDisplayName(), in, ccb, opts.optimizationLevel, collectionList);
                 JobSpecification spec = compiler.getModule().getHyracksJobSpecification();
                 in.close();
 
@@ -172,7 +218,11 @@ public class TestRunner {
                 System.err.println(res.result);
             }
         }
-        return res;
+
+    }
+
+    public void runQueries(TestCase testCase, TestCaseResult res) {
+        runQuery(testCase, res);
     }
 
     public void close() throws Exception {

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-1/useIndex1_user.txt
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-1/useIndex1_user.txt b/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-1/useIndex1_user.txt
new file mode 100644
index 0000000..baf9dca
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-1/useIndex1_user.txt
@@ -0,0 +1,2 @@
+<data><date>2003-03-03T00:00:00.000</date><dataType>TMIN</dataType><station>GHCND:AS000000003</station><value>13.75</value><attributes><attribute/><attribute/><attribute>a</attribute><attribute/></attributes></data>
+<data><date>2003-03-03T00:00:00.000</date><dataType>TMAX</dataType><station>GHCND:AS000000003</station><value>33</value><attributes><attribute/><attribute/><attribute>a</attribute></attributes></data>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-2/useIndex1_user.txt
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-2/useIndex1_user.txt b/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-2/useIndex1_user.txt
new file mode 100644
index 0000000..baf9dca
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-2/useIndex1_user.txt
@@ -0,0 +1,2 @@
+<data><date>2003-03-03T00:00:00.000</date><dataType>TMIN</dataType><station>GHCND:AS000000003</station><value>13.75</value><attributes><attribute/><attribute/><attribute>a</attribute><attribute/></attributes></data>
+<data><date>2003-03-03T00:00:00.000</date><dataType>TMAX</dataType><station>GHCND:AS000000003</station><value>33</value><attributes><attribute/><attribute/><attribute>a</attribute></attributes></data>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-4/useIndex1_user.txt
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-4/useIndex1_user.txt b/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-4/useIndex1_user.txt
new file mode 100644
index 0000000..baf9dca
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Indexing/Partition-4/useIndex1_user.txt
@@ -0,0 +1,2 @@
+<data><date>2003-03-03T00:00:00.000</date><dataType>TMIN</dataType><station>GHCND:AS000000003</station><value>13.75</value><attributes><attribute/><attribute/><attribute>a</attribute><attribute/></attributes></data>
+<data><date>2003-03-03T00:00:00.000</date><dataType>TMAX</dataType><station>GHCND:AS000000003</station><value>33</value><attributes><attribute/><attribute/><attribute>a</attribute></attributes></data>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1.xq
index 63fdda7..96a7671 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1.xq
@@ -16,10 +16,10 @@
    under the License. :)
    
 (: Search Lucene Index :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd")/dataCollection/data
 let $datetime := xs:dateTime(fn:data($r/date))
 where $r/station eq "GHCND:AS000000003" 
     and fn:year-from-dateTime($datetime) ge 2000
     and fn:month-from-dateTime($datetime) eq 3 
     and fn:day-from-dateTime($datetime) eq 3
-return $r
\ No newline at end of file
+return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1_user.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1_user.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1_user.xq
new file mode 100644
index 0000000..7a2bb2c
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex1_user.xq
@@ -0,0 +1,25 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+   
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License. :)
+   
+(: Search Lucene Index :)
+for $r in collection-from-index("src/test/resources/TestSources/ghcnd")/dataCollection/data
+let $datetime := xs:dateTime(fn:data($r/date))
+where $r/station eq "GHCND:AS000000003" 
+    and fn:year-from-dateTime($datetime) ge 2000
+    and fn:month-from-dateTime($datetime) eq 3 
+    and fn:day-from-dateTime($datetime) eq 3
+return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex2.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex2.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex2.xq
index cf41536..464c1cc 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex2.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex2.xq
@@ -19,6 +19,6 @@
 (: Find all reading for hurricane force wind warning or extreme wind warning. :)
 (: The warnings occur when the wind speed (AWND) exceeds 110 mph (49.1744     :)
 (: meters per second). (Wind value is in tenth of a meter per second)         :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd")/dataCollection/data
 where $r/dataType eq "AWND" and xs:decimal($r/value) gt 491.744
 return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex3.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex3.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex3.xq
index 5c99d9a..eeb019b 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex3.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex3.xq
@@ -19,7 +19,7 @@
 (: Find the annual precipitation (PRCP) for a Seattle using the airport       :)
 (: station (US000000002) for 2002.                                            :)
 fn:sum(
-    for $r in collection-from-index("src/test/resources/TestSources/ghcnd", "/dataCollection/data")/data
+    for $r in collection("src/test/resources/TestSources/ghcnd")/dataCollection/data
     where $r/station eq "GHCND:US000000002" 
         and $r/dataType eq "PRCP" 
         and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2002

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex4.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex4.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex4.xq
index 39e5d17..06284ae 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex4.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex4.xq
@@ -18,7 +18,7 @@
 (: Search Lucene Index :)
 (: Find the highest recorded temperature (TMAX) in Celsius.                   :)
 fn:max(
-    for $r in collection-from-index("src/test/resources/TestSources/ghcnd", "/dataCollection/data")/data
+    for $r in collection("src/test/resources/TestSources/ghcnd")/dataCollection/data
     where $r/dataType eq "TMAX"
     return $r/value
 ) div 10

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex5.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex5.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex5.xq
index 63aeca5..3a4ae05 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex5.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex5.xq
@@ -18,6 +18,6 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd")/dataCollection/data
 where xs:dateTime(fn:data($r/date)) eq xs:dateTime("2002-02-02T00:00:00.000")
 return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex6.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex6.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex6.xq
index c81f271..9090edd 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex6.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex6.xq
@@ -18,7 +18,7 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $s in collection-from-index("src/test/resources/TestSources/ghcnd", "/stationCollection/station")/station
+for $s in collection("src/test/resources/TestSources/ghcnd")/stationCollection/station
 where (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "STATE 1"))
 order by $s/id
 return $s

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex7.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex7.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex7.xq
index dd6b5f9..7c703b6 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex7.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/useIndex7.xq
@@ -18,8 +18,8 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $s in collection-from-index("src/test/resources/TestSources/ghcnd", "/stationCollection/station")/station
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd", "/dataCollection/data")/data
+for $s in collection("src/test/resources/TestSources/ghcnd")/stationCollection/station
+for $r in collection("src/test/resources/TestSources/ghcnd")/dataCollection/data
     
 where $s/id eq $r/station 
     and (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "STATE 1"))

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1.xq
index fecb56d..4718240 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1.xq
@@ -16,7 +16,7 @@
    under the License. :)
    
 (: Search Lucene Index :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/dataCollection/data
 let $datetime := xs:dateTime(fn:data($r/date))
 where $r/station eq "GHCND:AS000000003" 
     and fn:year-from-dateTime($datetime) ge 2000

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1_user.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1_user.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1_user.xq
new file mode 100644
index 0000000..0e42155
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex1_user.xq
@@ -0,0 +1,25 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+   
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License. :)
+   
+(: Search Lucene Index :)
+for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/dataCollection/data
+let $datetime := xs:dateTime(fn:data($r/date))
+where $r/station eq "GHCND:AS000000003" 
+    and fn:year-from-dateTime($datetime) ge 2000
+    and fn:month-from-dateTime($datetime) eq 3 
+    and fn:day-from-dateTime($datetime) eq 3
+return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex2.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex2.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex2.xq
index 75c7a64..37e5626 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex2.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex2.xq
@@ -19,6 +19,6 @@
 (: Find all reading for hurricane force wind warning or extreme wind warning. :)
 (: The warnings occur when the wind speed (AWND) exceeds 110 mph (49.1744     :)
 (: meters per second). (Wind value is in tenth of a meter per second)         :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/dataCollection/data
 where $r/dataType eq "AWND" and xs:decimal($r/value) gt 491.744
 return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex3.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex3.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex3.xq
index 28f7473..358d3f3 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex3.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex3.xq
@@ -19,7 +19,7 @@
 (: Find the annual precipitation (PRCP) for a Seattle using the airport       :)
 (: station (US000000002) for 2002.                                            :)
 fn:sum(
-    for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/dataCollection/data")/data
+    for $r in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/dataCollection/data
     where $r/station eq "GHCND:US000000002" 
         and $r/dataType eq "PRCP" 
         and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2002

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex4.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex4.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex4.xq
index 317a141..bd5ba1c 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex4.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex4.xq
@@ -18,7 +18,7 @@
 (: Search Lucene Index :)
 (: Find the highest recorded temperature (TMAX) in Celsius.                   :)
 fn:max(
-    for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/dataCollection/data")/data
+    for $r in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/dataCollection/data
     where $r/dataType eq "TMAX"
     return $r/value
 ) div 10

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex5.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex5.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex5.xq
index 2deb4c3..77f6c2f 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex5.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex5.xq
@@ -18,6 +18,6 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/dataCollection/data
 where xs:dateTime(fn:data($r/date)) eq xs:dateTime("2002-02-02T00:00:00.000")
 return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex6.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex6.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex6.xq
index a0ce1e9..c1a45f4 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex6.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex6.xq
@@ -18,6 +18,6 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $s in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/stationCollection/station")/station
+for $s in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/stationCollection/station
 where (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "STATE 1"))
 return $s

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex7.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex7.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex7.xq
index b3e622c..a776ab9 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex7.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-2/useIndex7.xq
@@ -18,8 +18,8 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $s in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/stationCollection/station")/station
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2", "/dataCollection/data")/data
+for $s in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/stationCollection/station
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1|src/test/resources/TestSources/ghcnd/half_2")/dataCollection/data
     
 where $s/id eq $r/station 
     and (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "STATE 1"))

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1.xq
index 0cccbc5..2bc9ce7 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1.xq
@@ -16,7 +16,7 @@
    under the License. :)
    
 (: Search Lucene Index :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/dataCollection/data
 let $datetime := xs:dateTime(fn:data($r/date))
 where $r/station eq "GHCND:AS000000003" 
     and fn:year-from-dateTime($datetime) ge 2000

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1_user.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1_user.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1_user.xq
new file mode 100644
index 0000000..e740365
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex1_user.xq
@@ -0,0 +1,25 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+   
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License. :)
+   
+(: Search Lucene Index :)
+for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/dataCollection/data
+let $datetime := xs:dateTime(fn:data($r/date))
+where $r/station eq "GHCND:AS000000003" 
+    and fn:year-from-dateTime($datetime) ge 2000
+    and fn:month-from-dateTime($datetime) eq 3 
+    and fn:day-from-dateTime($datetime) eq 3
+return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex2.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex2.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex2.xq
index c282e31..a1b86ac 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex2.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex2.xq
@@ -19,6 +19,6 @@
 (: Find all reading for hurricane force wind warning or extreme wind warning. :)
 (: The warnings occur when the wind speed (AWND) exceeds 110 mph (49.1744     :)
 (: meters per second). (Wind value is in tenth of a meter per second)         :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/dataCollection/data
 where $r/dataType eq "AWND" and xs:decimal($r/value) gt 491.744
 return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex3.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex3.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex3.xq
index 33ea1c9..9cc2b8e 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex3.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex3.xq
@@ -19,7 +19,7 @@
 (: Find the annual precipitation (PRCP) for a Seattle using the airport       :)
 (: station (US000000002) for 2002.                                            :)
 fn:sum(
-    for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/dataCollection/data")/data
+    for $r in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/dataCollection/data
     where $r/station eq "GHCND:US000000002" 
         and $r/dataType eq "PRCP" 
         and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2002

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex4.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex4.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex4.xq
index d213082..dd26e87 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex4.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex4.xq
@@ -18,7 +18,7 @@
 (: Search Lucene Index :)
 (: Find the highest recorded temperature (TMAX) in Celsius.                   :)
 fn:max(
-    for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/dataCollection/data")/data
+    for $r in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/dataCollection/data
     where $r/dataType eq "TMAX"
     return $r/value
 ) div 10

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex5.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex5.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex5.xq
index 1d98682..4a9d224 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex5.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex5.xq
@@ -18,6 +18,6 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/dataCollection/data")/data
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/dataCollection/data
 where xs:dateTime(fn:data($r/date)) eq xs:dateTime("2002-02-02T00:00:00.000")
 return $r

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex6.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex6.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex6.xq
index abe2184..4407079 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex6.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex6.xq
@@ -18,6 +18,6 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $s in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/stationCollection/station")/station
+for $s in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/stationCollection/station
 where (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "STATE 1"))
 return $s

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex7.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex7.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex7.xq
index 7b40ca0..664b150 100644
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex7.xq
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-4/useIndex7.xq
@@ -18,8 +18,8 @@
 (: Search Lucene Index :)
 (: Find all the weather readings for Washington state for a specific day    :)
 (: 2002-2-2.                                                                  :)
-for $s in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/stationCollection/station")/station
-for $r in collection-from-index("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4", "/dataCollection/data")/data
+for $s in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/stationCollection/station
+for $r in collection("src/test/resources/TestSources/ghcnd/half_1/quarter_1|src/test/resources/TestSources/ghcnd/half_1/quarter_2|src/test/resources/TestSources/ghcnd/half_2/quarter_3|src/test/resources/TestSources/ghcnd/half_2/quarter_4")/dataCollection/data
     
 where $s/id eq $r/station 
     and (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "STATE 1"))

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
index 5ecdb94..8e28135 100644
--- a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
+++ b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
@@ -353,7 +353,7 @@
          &LibrariesInJSONiq;
         </test-group>
     </test-group>
-   <test-group name="SerializationQueries" featureOwner="Christina Pavlopoulou">
+    <test-group name="SerializationQueries" featureOwner="Christina Pavlopoulou">
       <GroupInfo>
          <title>Serialize Function Queries</title>
          <description/>
@@ -365,7 +365,7 @@
          </GroupInfo>
          &SerializationQueries;
       </test-group>
-   </test-group>
+    </test-group>
     <test-group name="XMLInJSONQueries" featureOwner="Riyafa Abdul Hameed">
         <GroupInfo>
             <title>XML in JSON</title>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/4a38f670/vxquery-xtest/src/test/resources/cat/IndexingQueries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/IndexingQueries.xml b/vxquery-xtest/src/test/resources/cat/IndexingQueries.xml
index 7cf6bf6..cc6b65b 100644
--- a/vxquery-xtest/src/test/resources/cat/IndexingQueries.xml
+++ b/vxquery-xtest/src/test/resources/cat/IndexingQueries.xml
@@ -35,6 +35,11 @@
       <query name="useIndex1" date="2016-05-26"/>
       <output-file compare="Text">useIndex1.txt</output-file>
    </test-case>
+   <test-case name="use-index-1-user" FilePath="Indexing/Partition-1/" Creator="Steven Jacobs">
+      <description>Get Collection From Lucene Index</description>
+      <query name="useIndex1_user" date="2016-05-26"/>
+      <output-file compare="Text">useIndex1_user.txt</output-file>
+   </test-case>
    <test-case name="use-index-2" FilePath="Indexing/Partition-1/" Creator="Steven Jacobs">
       <description>Get Collection From Lucene Index</description>
       <query name="useIndex2" date="2016-05-26"/>
@@ -95,6 +100,11 @@
       <query name="useIndex1" date="2016-05-26"/>
       <output-file compare="Text">useIndex1.txt</output-file>
    </test-case>
+   <test-case name="use-index-1-user" FilePath="Indexing/Partition-2/" Creator="Steven Jacobs">
+      <description>Get Collection From Lucene Index</description>
+      <query name="useIndex1_user" date="2016-05-26"/>
+      <output-file compare="Text">useIndex1_user.txt</output-file>
+   </test-case>
    <test-case name="use-index-2" FilePath="Indexing/Partition-2/" Creator="Steven Jacobs">
       <description>Get Collection From Lucene Index</description>
       <query name="useIndex2" date="2016-05-26"/>
@@ -145,6 +155,11 @@
       <query name="useIndex1" date="2016-05-26"/>
       <output-file compare="Text">useIndex1.txt</output-file>
    </test-case>
+   <test-case name="use-index-1-user" FilePath="Indexing/Partition-4/" Creator="Steven Jacobs">
+      <description>Get Collection From Lucene Index</description>
+      <query name="useIndex1_user" date="2016-05-26"/>
+      <output-file compare="Text">useIndex1_user.txt</output-file>
+   </test-case>
    <test-case name="use-index-2" FilePath="Indexing/Partition-4/" Creator="Steven Jacobs">
       <description>Get Collection From Lucene Index</description>
       <query name="useIndex2" date="2016-05-26"/>


Mime
View raw message