usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [1/6] usergrid git commit: Fix issue with addSort being appended to delete queries many times when there are multiple versions of an entity.
Date Tue, 05 Apr 2016 20:49:13 GMT
Repository: usergrid
Updated Branches:
  refs/heads/release-2.1.1 a6cfda8ae -> ab028e96a


Fix issue with addSort being appended to delete queries many times when there are multiple
versions of an entity.


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

Branch: refs/heads/release-2.1.1
Commit: d3df23930218703cda5ea9e7fea86a52ba7efb4a
Parents: a6cfda8
Author: Michael Russo <mrusso@apigee.com>
Authored: Tue Apr 5 13:45:42 2016 -0700
Committer: Michael Russo <mrusso@apigee.com>
Committed: Tue Apr 5 13:45:42 2016 -0700

----------------------------------------------------------------------
 .../usergrid/persistence/index/impl/EsEntityIndexImpl.java  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/d3df2393/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 111e16b..98c0738 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
@@ -471,7 +471,9 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
         final QueryBuilder entityQuery = QueryBuilders
             .termQuery(IndexingUtils.EDGE_NODE_ID_FIELDNAME, IndexingUtils.nodeId(edge.getNodeId()));
 
-        final SearchRequestBuilder srb = searchRequestBuilderStrategyV2.getBuilder();
+        final SearchRequestBuilder srb = searchRequestBuilderStrategyV2.getBuilder()
+            .addSort(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME, SortOrder.ASC);
+
 
         if ( logger.isDebugEnabled() ) {
             logger.debug( "Searching for edges in (read alias): {}\n  nodeId: {},\n   query:
{} ",
@@ -496,7 +498,6 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
                 searchResponse = srb
                     .setQuery(finalQuery)
                     .setSize(searchLimit)
-                    .addSort(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME, SortOrder.ASC)
                     .execute()
                     .actionGet();
 
@@ -553,7 +554,8 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
         final QueryBuilder nodeQuery = QueryBuilders
             .termQuery(IndexingUtils.EDGE_NODE_ID_FIELDNAME, IndexingUtils.nodeId(entityId));
 
-        final SearchRequestBuilder srb = searchRequestBuilderStrategyV2.getBuilder();
+        final SearchRequestBuilder srb = searchRequestBuilderStrategyV2.getBuilder()
+            .addSort(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME, SortOrder.ASC);
 
         try {
 
@@ -580,7 +582,6 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
                 searchResponse = srb
                     .setQuery(finalQuery)
                     .setSize(searchLimit)
-                    .addSort(IndexingUtils.EDGE_TIMESTAMP_FIELDNAME, SortOrder.ASC)
                     .execute()
                     .actionGet();
 


Mime
View raw message