Added a hint to AQL to exclude secondary indexes from the query plan.
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
new file mode 100644
index 0000000..6d8435ef
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index-search-in-delete.aql
@@ -0,0 +1,31 @@
+/*
+ *  Description     : The hint to skip secondary indexes don't apply to the primary index
+ *                  : This test is intended to verify that the primary index is still used instead of a scan
+ *  Expected Result : Success
+ *  Date            : 21th December 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as closed {
+  number: int32, 
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int32, 
+  name: string,
+  age: int32?,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) primary key cid;
+
+delete $c from dataset Customers /*+ skip-index */ where $c.cid < 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
new file mode 100644
index 0000000..114784e
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/dont-skip-primary-index.aql
@@ -0,0 +1,24 @@
+/*
+ *  Description     : The hint to skip secondary indexes don't apply to the primary index
+ *                  : This test is intended to verify that the primary index is still used instead of a scan 
+ *  Expected Result : Success
+ *  Date            : 21th December 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-primary-16.adm";
+
+create type TestType as open {
+    fname : string,
+    lname : string
+}
+
+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"
+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
new file mode 100644
index 0000000..de3b154
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index-search-in-delete.aql
@@ -0,0 +1,24 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+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
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
new file mode 100644
index 0000000..8b80497
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-ngram-index.aql
@@ -0,0 +1,29 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
+write output to nc1:"rttest/inverted-index-basic_ngram-contains.adm";
+
+for $o in dataset('DBLP')
+/*+ skip-index */
+where 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
new file mode 100644
index 0000000..1c6b312
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-index-search-in-delete.aql
@@ -0,0 +1,29 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type MyRecord as closed {
+  id: int32,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+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]));
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
new file mode 100644
index 0000000..55e78fc
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-rtree-secondary-index.aql
@@ -0,0 +1,40 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type MyRecord as closed {
+  id: int32,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create nodegroup group1  if not exists on nc1, nc2;
+
+create dataset MyData(MyRecord)
+  primary key id on group1;
+
+load dataset MyData 
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
+
+create index rtree_index_point on MyData(point) type rtree;
+
+
+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]))
+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
new file mode 100644
index 0000000..aee356f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index-search-in-delete.aql
@@ -0,0 +1,32 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as closed {
+  number: int32, 
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int32, 
+  name: string,
+  age: int32,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int32? } ]
+}
+
+create dataset Customers(CustomerType) primary key cid;
+
+create index age_index on Customers(age);
+
+delete $c from dataset Customers /*+ skip-index */ where $c.age < 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
new file mode 100644
index 0000000..32a6b06
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-secondary-btree-index.aql
@@ -0,0 +1,26 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/btree-index_btree-secondary-57.adm";
+
+create type TestType as open {
+    id : int32,
+    fname : string,
+    lname : string
+}
+
+create dataset testdst(TestType) primary key id;
+
+create index sec_Idx on testdst(fname);
+
+for $emp in dataset('testdst') 
+/*+ skip-index */
+where $emp.fname >= "Max" and $emp.fname <= "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
new file mode 100644
index 0000000..a7620c9
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index-search-in-delete.aql
@@ -0,0 +1,25 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+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
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
new file mode 100644
index 0000000..2c95104
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/skip-index/skip-word-index.aql
@@ -0,0 +1,29 @@
+/*
+ * Description  : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause
+ * Expected Res : Success
+ * Date         : 21th December 2013
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+create index keyword_index on DBLP(title) type keyword;
+
+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
+return $o