usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [2/3] incubator-usergrid git commit: fix paging logic
Date Wed, 01 Apr 2015 16:23:16 GMT
fix paging logic


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

Branch: refs/heads/USERGRID-509
Commit: 38d002e63a760782b5fb202a2a77ecb8b820e28a
Parents: 0405838
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Wed Apr 1 09:40:45 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Wed Apr 1 09:40:45 2015 -0600

----------------------------------------------------------------------
 .../java/org/apache/usergrid/persistence/CollectionIT.java   | 2 +-
 .../persistence/index/impl/EntityToMapConverter.java         | 2 +-
 .../persistence/index/impl/EsApplicationEntityIndexImpl.java | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/38d002e6/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
index 3e1db1b..129a701 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
@@ -1529,7 +1529,7 @@ public class CollectionIT extends AbstractCoreIT {
                 .getProperty( "Recipient" ) ).get( "Username" );
 
         // selection results should be a list of lists
-//        List<Object> sr = query.getSelectionResults( r );
+//        List<Object> sr = query.getSelectionResults( r );(
 //        assertTrue( sr.size() == 1 );
 
         assertEquals( "fb_100000787138041", username );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/38d002e6/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
index fdd9b92..2d868d8 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
@@ -95,7 +95,7 @@ public class EntityToMapConverter {
             }
             else if ( f instanceof EntityObjectField) {
                 EntityObject eo = ( EntityObject ) field.getValue();
-                entityMap.put(EO_PREFIX + field.getName().toLowerCase(), entityToMap(eo)
); // recursion
+                entityMap.put(  field.getName().toLowerCase(), entityToMap(eo) ); // recursion
             }
             else if ( f instanceof StringField ) {
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/38d002e6/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
index eceff90..c5b3577 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
@@ -155,7 +155,7 @@ public class EsApplicationEntityIndexImpl implements ApplicationEntityIndex{
         }
         failureMonitor.success();
 
-        return parseResults(searchResponse);
+        return parseResults(searchResponse, limit);
     }
 
 
@@ -197,7 +197,7 @@ public class EsApplicationEntityIndexImpl implements ApplicationEntityIndex{
 
 
         failureMonitor.success();
-        return parseResults(searchResponse);
+        return parseResults(searchResponse, 1);
     }
 
     /**
@@ -260,7 +260,7 @@ public class EsApplicationEntityIndexImpl implements ApplicationEntityIndex{
 
 
 
-    private CandidateResults parseResults( final SearchResponse searchResponse) {
+    private CandidateResults parseResults( final SearchResponse searchResponse,final int
limit) {
 
         final SearchHits searchHits = searchResponse.getHits();
         final SearchHit[] hits = searchHits.getHits();
@@ -285,7 +285,7 @@ public class EsApplicationEntityIndexImpl implements ApplicationEntityIndex{
         final CandidateResults candidateResults = new CandidateResults(candidates);
         final String esScrollCursor = searchResponse.getScrollId();
 
-        if(esScrollCursor != null) {
+        if(esScrollCursor != null && hits.length>=limit) {
             candidateResults.initializeCursor();
 
             //now set this into our map module


Mime
View raw message