Source:
<code>public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) { VXQueryOptimizationContext vxqueryContext = (VXQueryOptimizationContext) context; String[] args = getFunctionalArguments(opRef, VXQueryCommons.collectionFunctions); VXQueryMetadataProvider metadata = (VXQueryMetadataProvider) context.getMetadataProvider(); if (args != null) { String collectionName = args[0]; int collectionId = vxqueryContext.newCollectionId(); String collectionTempName = collectionName; if (collectionName.contains("|")) { <START> collectionTempName = collectionName.substring(0, collectionName.indexOf("|")); <END> } if (metadata.indexExists(collectionTempName)) { VXQueryIndexingDataSource ids = VXQueryIndexingDataSource.create(collectionId, collectionName, SequenceType.create(AnyItemType.INSTANCE, Quantifier.QUANT_STAR), functionCall.getFunctionIdentifier().getName()); if (ids != null) { ids.setTotalDataSources(vxqueryContext.getTotalDataSources()); return setDataSourceScan(ids, opRef); } } VXQueryCollectionDataSource ds = VXQueryCollectionDataSource.create(collectionId, collectionName, SequenceType.create(AnyItemType.INSTANCE, Quantifier.QUANT_STAR)); if (ds != null) { ds.setTotalDataSources(vxqueryContext.getTotalDataSources()); if (args.length == 2) { ds.setTotalDataSources(vxqueryContext.getTotalDataSources()); ds.setTag(args[1]); } return setDataSourceScan(ds, opRef); } } return false; }</code><technical_language>paths in index, path</technical_language>

Target:
public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) { VXQueryOptimizationContext vxqueryContext = (VXQueryOptimizationContext) context; String[] args = getFunctionalArguments(opRef, VXQueryCommons.collectionFunctions); VXQueryMetadataProvider metadata = (VXQueryMetadataProvider) context.getMetadataProvider(); if (args != null) { String collectionName = args[0]; int collectionId = vxqueryContext.newCollectionId(); ArrayList<String> collectionTempName = new ArrayList<String>(); collectionTempName.add(collectionName); if (collectionName.contains("|")) { collectionTempName.remove(0); int index = collectionName.indexOf("|"); int start = 0; while (index >= 0) { collectionTempName.add(collectionName.substring(start, index)); start = index + 1; index = collectionName.indexOf("|", index + 1); if (index == -1) { collectionTempName.add(collectionName.substring(start)); } } } if (metadata.hasIndex(collectionTempName)) { VXQueryIndexingDataSource ids = VXQueryIndexingDataSource.create(collectionId, collectionName, SequenceType.create(AnyItemType.INSTANCE, Quantifier.QUANT_STAR), functionCall.getFunctionIdentifier().getName()); if (ids != null) { ids.setTotalDataSources(vxqueryContext.getTotalDataSources()); return setDataSourceScan(ids, opRef); } } VXQueryCollectionDataSource ds = VXQueryCollectionDataSource.create(collectionId, collectionName, SequenceType.create(AnyItemType.INSTANCE, Quantifier.QUANT_STAR)); if (ds != null) { ds.setTotalDataSources(vxqueryContext.getTotalDataSources()); if (args.length == 2) { ds.setTotalDataSources(vxqueryContext.getTotalDataSources()); ds.setTag(args[1]); } return setDataSourceScan(ds, opRef); } } return false; }