Moved the skip secondary index search hint closer to the predicates.
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
index 25395e5..8fb0baa 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
@@ -1395,7 +1395,7 @@
             String dataverseName = getActiveDataverseName(stmtDelete.getDataverseName());
             CompiledDeleteStatement clfrqs = new CompiledDeleteStatement(stmtDelete.getVariableExpr(), dataverseName,
                     stmtDelete.getDatasetName().getValue(), stmtDelete.getCondition(), stmtDelete.getVarCounter(),
-                    stmtDelete.hasSkipSecondaryIndexSearchHint(), metadataProvider);
+                    metadataProvider);
             JobSpecification compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
 
             MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
@@ -1892,4 +1892,4 @@
             throw new IllegalStateException(rootE);
         }
     }
-}
+}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index-search-in-delete.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index-search-in-delete.aql
index 6d8435ef..1c6f069 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index-search-in-delete.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index-search-in-delete.aql
@@ -27,5 +27,5 @@
 
 create dataset Customers(CustomerType) primary key cid;
 
-delete $c from dataset Customers /*+ skip-index */ where $c.cid < 10;
+delete $c from dataset Customers where $c.cid /*+ skip-index */ < 10;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index.aql
index 114784e..77f9e8e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index.aql
@@ -19,6 +19,5 @@
 create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
-/*+ skip-index */
-where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
+where $emp.fname /*+ skip-index */ >= "Craig" and $emp.lname /*+ skip-index */ >= "Kevin" and $emp.fname /*+ skip-index */ <= "Mary" and $emp.lname /*+ skip-index */ <= "Tomes"
 return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index-search-in-delete.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index-search-in-delete.aql
index de3b154..b8fc5ab 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index-search-in-delete.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index-search-in-delete.aql
@@ -21,4 +21,4 @@
 
 create index ngram_index on DBLP(title) type ngram(3);
 
-delete $o from dataset DBLP /*+ skip-index */ where contains($o.title, "Multimedia")
\ No newline at end of file
+delete $o from dataset DBLP where /*+ skip-index */ contains($o.title, "Multimedia")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index.aql
index 8b80497..1ae5fe9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index.aql
@@ -23,7 +23,6 @@
 write output to nc1:"rttest/inverted-index-basic_ngram-contains.adm";
 
 for $o in dataset('DBLP')
-/*+ skip-index */
-where contains($o.title, "Multimedia")
+where /*+ skip-index */ contains($o.title, "Multimedia")
 order by $o.id
 return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-index-search-in-delete.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-index-search-in-delete.aql
index 1c6b312..3403ef1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-index-search-in-delete.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-index-search-in-delete.aql
@@ -26,4 +26,4 @@
 
 create index rtree_index_point on MyData(point) type rtree;
 
-delete $m from dataset MyData /*+ skip-index */ where spatial-intersect($m.point, create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]));
+delete $m from dataset MyData where /*+ skip-index */ spatial-intersect($m.point, create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]));
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-secondary-index.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-secondary-index.aql
index 55e78fc..52fb83d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-secondary-index.aql
@@ -35,6 +35,5 @@
 write output to nc1:"rttest/index_rtree-secondary-index.adm";
 
 for $o in dataset('MyData')
-/*+ skip-index */
-where spatial-intersect($o.point, create-polygon([4.0,1.0,4.0,4.0,12.0,4.0,12.0,1.0]))
+where /*+ skip-index */ spatial-intersect($o.point, create-polygon([4.0,1.0,4.0,4.0,12.0,4.0,12.0,1.0]))
 return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index-search-in-delete.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index-search-in-delete.aql
index aee356f..a0096ff 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index-search-in-delete.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index-search-in-delete.aql
@@ -28,5 +28,5 @@
 
 create index age_index on Customers(age);
 
-delete $c from dataset Customers /*+ skip-index */ where $c.age < 20;
+delete $c from dataset Customers where $c.age /*+ skip-index */ < 20;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index.aql
index 32a6b06..abf77c6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index.aql
@@ -21,6 +21,5 @@
 create index sec_Idx on testdst(fname);
 
 for $emp in dataset('testdst') 
-/*+ skip-index */
-where $emp.fname >= "Max" and $emp.fname <= "Roger" 
+where $emp.fname /*+ skip-index */ >= "Max" and $emp.fname /*+ skip-index */ <= "Roger" 
 return $emp
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index-search-in-delete.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index-search-in-delete.aql
index a7620c9..53010a0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index-search-in-delete.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index-search-in-delete.aql
@@ -22,4 +22,4 @@
 
 create index keyword_index on DBLP(title) type keyword;
 
-delete $o from dataset DBLP /*+ skip-index */ where similarity-jaccard(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments")) >= 0.5f
\ No newline at end of file
+delete $o from dataset DBLP where /*+ skip-index */ similarity-jaccard(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments")) >= 0.5f
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index.aql b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index.aql
index 2c95104..a9cdfbb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index.aql
@@ -24,6 +24,6 @@
 write output to nc1:"rttest/inverted-index-basic_word-jaccard.adm";
 
 for $o in dataset('DBLP')
-/*+ skip-index */
-where similarity-jaccard(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments")) >= 0.5f
+let $jacc := /*+ skip-index */ similarity-jaccard(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"))
+where $jacc >= 0.5f
 return $o