Revert "Convert delete ES queries to filters instead of queries."

This reverts commit 30ba1305c065e4f731b1f4dc9d2a8aa004fb8e13.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5dc33245
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5dc33245
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5dc33245

Branch: refs/heads/master
Commit: 5dc33245610b9ad0b9213064f101bb677993e003
Parents: 30ba130
Author: Michael Russo <mru...@apigee.com>
Authored: Wed Jul 20 12:46:16 2016 +0100
Committer: Michael Russo <mru...@apigee.com>
Committed: Wed Jul 20 12:46:16 2016 +0100

----------------------------------------------------------------------
 .../index/impl/EsEntityIndexImpl.java           | 28 ++++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/5dc33245/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
 
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index f379e80..6e04bed 100644
--- 
a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ 
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -469,11 +469,11 @@ public class EsEntityIndexImpl implements 
EntityIndex,VersionedData {
         // never let this fetch more than 100 to save memory
         final int searchLimit = Math.min(100, indexFig.getVersionQueryLimit());
 
-        final FilterBuilder nodeIdQuery = FilterBuilders
-            .termFilter(IndexingUtils.EDGE_NODE_ID_FIELDNAME, 
IndexingUtils.nodeId(edge.getNodeId()));
+        final QueryBuilder nodeIdQuery = QueryBuilders
+            .termQuery(IndexingUtils.EDGE_NODE_ID_FIELDNAME, 
IndexingUtils.nodeId(edge.getNodeId()));
 
-        final FilterBuilder entityIdQuery = FilterBuilders
-            .termFilter(IndexingUtils.ENTITY_ID_FIELDNAME, 
IndexingUtils.entityId(entityId));
+        final QueryBuilder entityIdQuery = QueryBuilders
+            .termQuery(IndexingUtils.ENTITY_ID_FIELDNAME, 
IndexingUtils.entityId(entityId));
 
         final SearchRequestBuilder srb = 
searchRequestBuilderStrategyV2.getBuilder()
             .addSort(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME, SortOrder.ASC);
@@ -489,13 +489,13 @@ public class EsEntityIndexImpl implements 
EntityIndex,VersionedData {
             long queryTimestamp = 0L;
 
 
-            FilterBuilder timestampQuery =  FilterBuilders
-                .rangeFilter(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME)
+            QueryBuilder timestampQuery =  QueryBuilders
+                .rangeQuery(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME)
                 .gte(queryTimestamp);
 
             QueryBuilder finalQuery = QueryBuilders.constantScoreQuery(
-                FilterBuilders
-                    .boolFilter()
+                QueryBuilders
+                    .boolQuery()
                     .must(entityIdQuery)
                     .must(nodeIdQuery)
                     .must(timestampQuery)
@@ -539,8 +539,8 @@ public class EsEntityIndexImpl implements 
EntityIndex,VersionedData {
         final int searchLimit = Math.min(100, indexFig.getVersionQueryLimit());
 
         // this query will find all the documents where this entity is a 
source/target node
-        final FilterBuilder nodeQuery = FilterBuilders
-            .termFilter(IndexingUtils.EDGE_NODE_ID_FIELDNAME, 
IndexingUtils.nodeId(entityId));
+        final QueryBuilder nodeQuery = QueryBuilders
+            .termQuery(IndexingUtils.EDGE_NODE_ID_FIELDNAME, 
IndexingUtils.nodeId(entityId));
 
         final SearchRequestBuilder srb = 
searchRequestBuilderStrategyV2.getBuilder()
             .addSort(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME, SortOrder.ASC);
@@ -549,14 +549,14 @@ public class EsEntityIndexImpl implements 
EntityIndex,VersionedData {
 
             long queryTimestamp = 0L;
 
-            FilterBuilder timestampQuery =  FilterBuilders
-                .rangeFilter(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME)
+            QueryBuilder timestampQuery =  QueryBuilders
+                .rangeQuery(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME)
                 .gte(queryTimestamp)
                 .lt(markedTimestamp);
 
             QueryBuilder finalQuery = QueryBuilders.constantScoreQuery(
-                FilterBuilders
-                    .boolFilter()
+                QueryBuilders
+                    .boolQuery()
                     .must(timestampQuery)
                     .must(nodeQuery)
             );

Reply via email to