usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [14/33] incubator-usergrid git commit: Updated geo tests and fixed geo sorting
Date Mon, 13 Apr 2015 19:18:21 GMT
Updated geo tests and fixed geo sorting


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

Branch: refs/heads/two-dot-o-dev
Commit: 05c27647737e301ac5caad2280bab5b88e73f1a4
Parents: 9655534
Author: Todd Nine <tnine@apigee.com>
Authored: Wed Apr 8 09:56:52 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Wed Apr 8 17:15:33 2015 -0600

----------------------------------------------------------------------
 .../persistence/index/impl/EsQueryVistor.java   |  44 ++++--
 .../persistence/index/impl/GeoSortFields.java   |  95 +++++++++++
 .../persistence/index/impl/IndexingUtils.java   |   2 +-
 .../impl/SearchRequestBuilderStrategy.java      | 100 +++++++++---
 .../persistence/index/impl/SortBuilder.java     |  44 ++++++
 .../index/query/tree/QueryVisitor.java          |   8 +-
 .../index/impl/CorePerformanceIT.java           |   0
 .../impl/EntityConnectionIndexImplTest.java     |   0
 .../persistence/index/impl/EntityIndexTest.java |  87 ++++++----
 .../persistence/index/impl/GeoPagingTest.java   | 158 +++++++++++++++++++
 .../index/impl/IndexLoadTestsIT.java            |   4 -
 .../src/test/resources/log4j.properties         |   6 +-
 .../queryindex/src/test/resources/test.json     | 133 ----------------
 .../usergrid/persistence/queue/QueueFig.java    |   8 +
 14 files changed, 489 insertions(+), 200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsQueryVistor.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsQueryVistor.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsQueryVistor.java
index 9f0e68f..316a297 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsQueryVistor.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsQueryVistor.java
@@ -19,10 +19,12 @@
 package org.apache.usergrid.persistence.index.impl;
 
 
-import java.util.HashSet;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 import java.util.Stack;
 
+import org.elasticsearch.common.geo.GeoDistance;
 import org.elasticsearch.common.unit.DistanceUnit;
 import org.elasticsearch.index.query.BoolFilterBuilder;
 import org.elasticsearch.index.query.BoolQueryBuilder;
@@ -36,6 +38,8 @@ import org.elasticsearch.index.query.QueryBuilders;
 import org.elasticsearch.index.query.RangeFilterBuilder;
 import org.elasticsearch.index.query.TermFilterBuilder;
 import org.elasticsearch.index.query.WildcardQueryBuilder;
+import org.elasticsearch.search.sort.GeoDistanceSortBuilder;
+import org.elasticsearch.search.sort.SortBuilders;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,6 +60,8 @@ import org.apache.usergrid.persistence.index.query.tree.WithinOperand;
 
 import com.google.common.base.Optional;
 
+import static org.apache.usergrid.persistence.index.impl.SortBuilder.sortPropertyTermFilter;
+
 
 /**
  * Visits tree of  parsed Query operands and populates ElasticSearch QueryBuilder that represents
the query.
@@ -73,7 +79,8 @@ public class EsQueryVistor implements QueryVisitor {
      */
     private final Stack<FilterBuilder> filterBuilders = new Stack<>();
 
-    private final Set<String> geoFields = new HashSet<String>();
+    private final GeoSortFields geoSortFields = new GeoSortFields();
+
 
 
     @Override
@@ -265,19 +272,36 @@ public class EsQueryVistor implements QueryVisitor {
 
         final String name = op.getProperty().getValue().toLowerCase();
 
-        geoFields.add( name );
 
         float lat = op.getLatitude().getFloatValue();
         float lon = op.getLongitude().getFloatValue();
         float distance = op.getDistance().getFloatValue();
 
 
-        final FilterBuilder fb = FilterBuilders.geoDistanceFilter( name ).lat( lat ).lon(
lon )
+        final FilterBuilder fb = FilterBuilders.geoDistanceFilter( IndexingUtils.FIELD_LOCATION_NESTED
).lat( lat ).lon( lon )
                                                .distance( distance, DistanceUnit.METERS );
-        filterBuilders.push( fb );
 
+
+        filterBuilders.push( fieldNameTerm( name, fb ) );
+
+
+        //create our geo-sort based off of this point specified
+
+        //this geoSort won't has a sort on it
+
+        final GeoDistanceSortBuilder geoSort =
+                      SortBuilders.geoDistanceSort( IndexingUtils.FIELD_LOCATION_NESTED )
+                                  .unit( DistanceUnit.METERS ).geoDistance( GeoDistance.SLOPPY_ARC
).point( lat, lon );
+
+        final TermFilterBuilder sortPropertyName = sortPropertyTermFilter( name );
+
+        geoSort.setNestedFilter( sortPropertyName );
+
+
+        geoSortFields.addField( name, geoSort );
         //no op for query, push
 
+
         queryBuilders.push( NoOpQueryBuilder.INSTANCE );
     }
 
@@ -421,6 +445,11 @@ public class EsQueryVistor implements QueryVisitor {
     }
 
 
+    @Override
+    public GeoSortFields getGeoSorts() {
+        return geoSortFields;
+    }
+
 
     /**
      * Generate the field name term for the field name  for queries
@@ -508,9 +537,4 @@ public class EsQueryVistor implements QueryVisitor {
         return filterBuilder != NoOpFilterBuilder.INSTANCE;
     }
 
-
-    @Override
-    public Set<String> getGeoSelectFields() {
-        return geoFields;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/GeoSortFields.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/GeoSortFields.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/GeoSortFields.java
new file mode 100644
index 0000000..fcafcd2
--- /dev/null
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/GeoSortFields.java
@@ -0,0 +1,95 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *    http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+
+package org.apache.usergrid.persistence.index.impl;
+
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.elasticsearch.search.sort.GeoDistanceSortBuilder;
+import org.elasticsearch.search.sort.SortOrder;
+
+
+/**
+ * Helper class for creating geo sort fields
+ */
+public class GeoSortFields {
+
+
+    private final Map<String, GeoDistanceSortBuilder> geoSorts = new HashMap<>();
+
+
+    /**
+     * Add a geo sort field to this sorts
+     * @param name
+     * @param sortBuilder
+     */
+    public void addField(final String name, final GeoDistanceSortBuilder sortBuilder){
+        this.geoSorts.put( name, sortBuilder );
+    }
+
+
+    /**
+     * Return true if we have a sort of for this key
+     * @param name
+     * @return
+     */
+    public boolean contains(final String name){
+        return geoSorts.containsKey( name );
+    }
+
+
+    /**
+     * Return true if empty
+     * @return
+     */
+    public boolean isEmpty(){
+        return geoSorts.isEmpty();
+    }
+
+
+    /**
+     * Returns all fields in this geo sort
+     * @return
+     */
+    public Set<String> fields(){
+        return geoSorts.keySet();
+    }
+
+    /**
+     * Apply the ordering to our geo sorts. Note this will modify the object stored in this
geoSort
+     * @param name
+     * @param sortOrder
+     */
+    public GeoDistanceSortBuilder applyOrder( final String name, SortOrder sortOrder ){
+
+        final GeoDistanceSortBuilder geoDistanceSortBuilder = geoSorts.get( name );
+
+        geoDistanceSortBuilder.order( sortOrder );
+
+        return geoDistanceSortBuilder;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
index 99c3914..7a70e15 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
@@ -90,7 +90,7 @@ public class IndexingUtils {
     public static final String FIELD_BOOLEAN_NESTED = ENTITY_FIELDS + "." + FIELD_BOOLEAN;
     public static final String FIELD_LONG_NESTED = ENTITY_FIELDS + "." + FIELD_LONG;
     public static final String FIELD_DOUBLE_NESTED = ENTITY_FIELDS + "." + FIELD_DOUBLE;
-    public static final String SORT_FIELD_LOCATION = ENTITY_FIELDS + "." + FIELD_LOCATION;
+    public static final String FIELD_LOCATION_NESTED = ENTITY_FIELDS + "." + FIELD_LOCATION;
     public static final String FIELD_STRING_NESTED = ENTITY_FIELDS + "." + FIELD_STRING;
     public static final String FIELD_STRING_EQUALS_NESTED = FIELD_STRING_NESTED + ".exact";
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SearchRequestBuilderStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SearchRequestBuilderStrategy.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SearchRequestBuilderStrategy.java
index 49be2e9..8c5b1a0 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SearchRequestBuilderStrategy.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SearchRequestBuilderStrategy.java
@@ -20,15 +20,18 @@
 package org.apache.usergrid.persistence.index.impl;
 
 
+import java.util.Set;
+
 import org.elasticsearch.action.search.SearchRequestBuilder;
+import org.elasticsearch.common.geo.GeoDistance;
+import org.elasticsearch.common.unit.DistanceUnit;
 import org.elasticsearch.index.query.BoolFilterBuilder;
-import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.FilterBuilder;
 import org.elasticsearch.index.query.FilterBuilders;
 import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
 import org.elasticsearch.index.query.TermFilterBuilder;
 import org.elasticsearch.search.sort.FieldSortBuilder;
+import org.elasticsearch.search.sort.GeoDistanceSortBuilder;
 import org.elasticsearch.search.sort.SortBuilders;
 import org.elasticsearch.search.sort.SortOrder;
 import org.slf4j.Logger;
@@ -47,6 +50,7 @@ import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.createContextName;
+import static org.apache.usergrid.persistence.index.impl.SortBuilder.sortPropertyTermFilter;
 
 
 /**
@@ -73,6 +77,9 @@ public class SearchRequestBuilderStrategy {
     }
 
 
+    /**
+     * Get the search request builder
+     */
     public SearchRequestBuilder getBuilder( final SearchEdge searchEdge, final SearchTypes
searchTypes,
                                             final ParsedQuery query, final int limit ) {
 
@@ -83,31 +90,72 @@ public class SearchRequestBuilderStrategy {
                 esProvider.getClient().prepareSearch( alias.getReadAlias() ).setTypes( IndexingUtils.ES_ENTITY_TYPE
)
                           .setScroll( cursorTimeout + "m" );
 
-        //TODO, make this work
-        //        searchTypes.getTypeNames( applicationScope )
-
         final QueryVisitor visitor = visitParsedQuery( query );
 
         final Optional<QueryBuilder> queryBuilder = visitor.getQueryBuilder();
 
-        if(queryBuilder.isPresent()){
-          srb.setQuery( queryBuilder.get() );
+        if ( queryBuilder.isPresent() ) {
+            srb.setQuery( queryBuilder.get() );
         }
 
-        srb.setPostFilter(createFilterBuilder( searchEdge, visitor, searchTypes ) );
+        srb.setPostFilter( createFilterBuilder( searchEdge, visitor, searchTypes ) );
 
 
         srb = srb.setFrom( 0 ).setSize( limit );
 
+
+        //if we have a geo field, sort by closest to farthest by default
+        final GeoSortFields geoFields = visitor.getGeoSorts();
+
+
         //no sort predicates, sort by edge time descending, entity id second
         if ( query.getSortPredicates().size() == 0 ) {
+            applyDefaultSortPredicates( srb, geoFields );
+        }
+        else {
+            applySortPredicates( srb, query, geoFields );
+        }
+
+
+        return srb;
+    }
+
+
+    /**
+     * Apply our default sort predicate logic
+     */
+    private void applyDefaultSortPredicates( final SearchRequestBuilder srb, final GeoSortFields
geoFields ) {
+
+
+        if ( geoFields.isEmpty() ) {
+
             //sort by the edge timestamp
             srb.addSort( SortBuilders.fieldSort( IndexingUtils.EDGE_TIMESTAMP_FIELDNAME ).order(
SortOrder.DESC ) );
 
             //sort by the entity id if our times are equal
             srb.addSort( SortBuilders.fieldSort( IndexingUtils.ENTITY_ID_FIELDNAME ).order(
SortOrder.ASC ) );
+            return;
         }
 
+        //we have geo fields, sort through them in visit order
+
+
+        for ( String geoField : geoFields.fields() ) {
+
+            final GeoDistanceSortBuilder geoSort = geoFields.applyOrder(geoField,  SortOrder.ASC);
+
+            srb.addSort( geoSort );
+        }
+    }
+
+
+    /**
+     * Invoked when there are sort predicates
+     */
+    private void applySortPredicates( final SearchRequestBuilder srb, final ParsedQuery query,
+                                      final GeoSortFields geoFields ) {
+
+
         //we have sort predicates, sort them
         for ( SortPredicate sp : query.getSortPredicates() ) {
 
@@ -116,29 +164,40 @@ public class SearchRequestBuilderStrategy {
             // type prefix to use. So, here we add an order by clause for every possible
type
             // that you can order by: string, number and boolean and we ask ElasticSearch
             // to ignore any fields that are not present.
-
             final SortOrder order = sp.getDirection().toEsSort();
             final String propertyName = sp.getPropertyName();
 
 
-            srb.addSort( createSort( order, IndexingUtils.FIELD_STRING_NESTED, propertyName
) );
+            //if the user specified a geo field in their sort, then honor their sort order
+            if ( geoFields.contains( propertyName ) ) {
+                final GeoDistanceSortBuilder geoSort = geoFields.applyOrder(propertyName,
 SortOrder.ASC);
+
+                srb.addSort( geoSort );
+            }
 
+            //apply regular sort logic, since this is not a geo point
+            else {
 
-            srb.addSort( createSort( order, IndexingUtils.FIELD_DOUBLE_NESTED, propertyName
) );
+                srb.addSort( createSort( order, IndexingUtils.FIELD_STRING_NESTED, propertyName
) );
 
-            srb.addSort( createSort( order, IndexingUtils.FIELD_BOOLEAN_NESTED, propertyName
) );
 
+                srb.addSort( createSort( order, IndexingUtils.FIELD_DOUBLE_NESTED, propertyName
) );
 
-            srb.addSort( createSort( order, IndexingUtils.FIELD_LONG_NESTED, propertyName
) );
+                srb.addSort( createSort( order, IndexingUtils.FIELD_BOOLEAN_NESTED, propertyName
) );
 
+
+                srb.addSort( createSort( order, IndexingUtils.FIELD_LONG_NESTED, propertyName
) );
+            }
         }
-        return srb;
     }
 
 
-
-    public BoolFilterBuilder createFilterBuilder( final SearchEdge searchEdge, final QueryVisitor
visitor,
-                                                  final SearchTypes searchTypes ) {
+    /**
+     * Create our filter builder.  We need to restrict our results on edge search, as well
as on types, and any filters
+     * that came from the grammar.
+     */
+    private FilterBuilder createFilterBuilder( final SearchEdge searchEdge, final QueryVisitor
visitor, final
+    SearchTypes searchTypes ) {
         String context = createContextName( applicationScope, searchEdge );
 
 
@@ -164,8 +223,8 @@ public class SearchRequestBuilderStrategy {
 
         final FilterBuilder[] typeTerms = new FilterBuilder[sourceTypes.length];
 
-        for(int i = 0; i < sourceTypes.length; i ++){
-            typeTerms[i] = FilterBuilders.termFilter(  IndexingUtils.ENTITY_TYPE_FIELDNAME,
sourceTypes[i]  );
+        for ( int i = 0; i < sourceTypes.length; i++ ) {
+            typeTerms[i] = FilterBuilders.termFilter( IndexingUtils.ENTITY_TYPE_FIELDNAME,
sourceTypes[i] );
         }
 
         //add all our types, 1 type must match per query
@@ -203,6 +262,7 @@ public class SearchRequestBuilderStrategy {
     }
 
 
+
     /**
      * Create a sort for the property name and field name specified
      *
@@ -213,7 +273,7 @@ public class SearchRequestBuilderStrategy {
     private FieldSortBuilder createSort( final SortOrder sortOrder, final String fieldName,
                                          final String propertyName ) {
 
-        final TermFilterBuilder propertyFilter = FilterBuilders.termFilter( IndexingUtils.FIELD_NAME,
propertyName );
+        final TermFilterBuilder propertyFilter = sortPropertyTermFilter( propertyName );
 
 
         return SortBuilders.fieldSort( fieldName ).order( sortOrder ).ignoreUnmapped( true
)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SortBuilder.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SortBuilder.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SortBuilder.java
new file mode 100644
index 0000000..5a3123a
--- /dev/null
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/SortBuilder.java
@@ -0,0 +1,44 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *    http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+
+package org.apache.usergrid.persistence.index.impl;
+
+
+import org.elasticsearch.index.query.FilterBuilders;
+import org.elasticsearch.index.query.TermFilterBuilder;
+
+
+/**
+ * Utility for building sorts with our indexing scheme
+ */
+public class SortBuilder {
+
+
+    /**
+     * Create a term filter for our sorts
+     */
+    public static TermFilterBuilder sortPropertyTermFilter( final String propertyName ) {
+        return FilterBuilders.termFilter( IndexingUtils.FIELD_NAME, propertyName );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/QueryVisitor.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/QueryVisitor.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/QueryVisitor.java
index 3fb0777..273f23f 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/QueryVisitor.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/QueryVisitor.java
@@ -20,15 +20,18 @@ package org.apache.usergrid.persistence.index.query.tree;
 
 
 import java.util.Collection;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.usergrid.persistence.index.exceptions.NoFullTextIndexException;
 import org.apache.usergrid.persistence.index.exceptions.NoIndexException;
 import org.apache.usergrid.persistence.index.exceptions.IndexException;
+import org.apache.usergrid.persistence.index.impl.GeoSortFields;
 import org.apache.usergrid.persistence.index.query.SortPredicate;
 
 import org.elasticsearch.index.query.FilterBuilder;
 import org.elasticsearch.index.query.QueryBuilder;
+import org.elasticsearch.search.sort.GeoDistanceSortBuilder;
 
 import com.google.common.base.Optional;
 
@@ -119,7 +122,8 @@ public interface QueryVisitor {
      * Some searches, such as geo have a side effect of adding a geo sort.  Get any sorts
that are side effects
      * of the query terms, in the order they should be applied.  Note that user specified
sort orders will trump
      * these sorts
-     * @return
+     *
+     * @return The GeoSortFields  null safe
      */
-    Set<String> getGeoSelectFields();
+    GeoSortFields getGeoSorts();
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CorePerformanceIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CorePerformanceIT.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CorePerformanceIT.java
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index 7aa6d4f..470b934 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -29,7 +29,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -44,6 +43,7 @@ import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.core.util.Health;
 import org.apache.usergrid.persistence.index.ApplicationEntityIndex;
+import org.apache.usergrid.persistence.index.CandidateResult;
 import org.apache.usergrid.persistence.index.CandidateResults;
 import org.apache.usergrid.persistence.index.EntityIndex;
 import org.apache.usergrid.persistence.index.EntityIndexBatch;
@@ -58,6 +58,7 @@ import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.field.ArrayField;
 import org.apache.usergrid.persistence.model.field.EntityObjectField;
+import org.apache.usergrid.persistence.model.field.IntegerField;
 import org.apache.usergrid.persistence.model.field.StringField;
 import org.apache.usergrid.persistence.model.field.UUIDField;
 import org.apache.usergrid.persistence.model.field.value.EntityObject;
@@ -118,8 +119,11 @@ public class EntityIndexTest extends BaseIT {
     }
 
 
+    /**
+     * Tests that when types conflict, but should match queries they work
+     * @throws IOException
+     */
     @Test
-    @Ignore( "this is a problem i will work on when i can breathe" )
     public void testIndexVariations() throws IOException {
         Id appId = new SimpleId( "application" );
 
@@ -128,33 +132,62 @@ public class EntityIndexTest extends BaseIT {
         ApplicationEntityIndex entityIndex = eif.createApplicationEntityIndex( applicationScope
);
 
         final String entityType = "thing";
-        IndexEdge indexEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE,
 1 );
+        IndexEdge indexEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE,
1 );
         final SearchTypes searchTypes = SearchTypes.fromTypes( entityType );
         EntityIndexBatch batch = entityIndex.createBatch();
-        Entity entity = new Entity( entityType );
-        EntityUtils.setVersion( entity, UUIDGenerator.newTimeUUID() );
-        entity.setField( new UUIDField( IndexingUtils.ENTITY_ID_FIELDNAME, UUID.randomUUID()
) );
-        entity.setField( new StringField( "testfield", "test" ) );
-        batch.index( indexEdge, entity );
+
+
+        Entity entity1 = new Entity( entityType );
+        EntityUtils.setVersion( entity1, UUIDGenerator.newTimeUUID() );
+        entity1.setField( new UUIDField( IndexingUtils.ENTITY_ID_FIELDNAME, UUID.randomUUID()
) );
+        entity1.setField( new StringField( "testfield", "test" ) );
+        entity1.setField( new IntegerField( "ordinal", 0 ) );
+
+
+        batch.index( indexEdge, entity1 );
         batch.execute().get();
 
-        EntityUtils.setVersion( entity, UUIDGenerator.newTimeUUID() );
+
+
+
+        Entity entity2 = new Entity( entityType );
+        EntityUtils.setVersion( entity2, UUIDGenerator.newTimeUUID() );
+
+
         List<String> list = new ArrayList<>();
         list.add( "test" );
-        entity.setField( new ArrayField<String>( "testfield", list ) );
-        batch.index( indexEdge, entity );
-        batch.execute().get();
+        entity2.setField( new ArrayField<>( "testfield", list ) );
+        entity2.setField( new IntegerField( "ordinal", 1 ) );
 
-        EntityUtils.setVersion( entity, UUIDGenerator.newTimeUUID() );
-        EntityObject testObj = new EntityObject();
-        testObj.setField( new StringField( "test", "testFiedl" ) );
-        entity.setField( new EntityObjectField( "testfield", testObj ) );
-        batch.index( indexEdge, entity );
+
+        batch.index( indexEdge, entity2 );
         batch.execute().get();
 
         ei.refresh();
 
-        testQueries( indexEdge, searchTypes, entityIndex );
+
+        StopWatch timer = new StopWatch();
+        timer.start();
+        CandidateResults candidateResults =
+                entityIndex.search( indexEdge, searchTypes, "select * where testfield = 'test'
order by ordinal", 100 );
+
+        timer.stop();
+
+        assertEquals( 2, candidateResults.size() );
+        log.debug( "Query time {}ms", timer.getTime() );
+
+        final CandidateResult candidate1 = candidateResults.get( 0 );
+
+        //check the id and version
+        assertEquals( entity1.getId(), candidate1.getId() );
+        assertEquals( entity1.getVersion(), candidate1.getVersion() );
+
+
+        final CandidateResult candidate2 = candidateResults.get( 1 );
+
+        //check the id and version
+        assertEquals( entity2.getId(), candidate2.getId() );
+        assertEquals( entity2.getVersion(), candidate2.getVersion() );
     }
 
 
@@ -178,13 +211,12 @@ public class EntityIndexTest extends BaseIT {
         final List<Object> sampleJson = mapper.readValue( is, new TypeReference<List<Object>>()
{} );
         for ( int i = 0; i < threads; i++ ) {
 
-            final IndexEdge indexEdge = new IndexEdgeImpl( appId, "things",  SearchEdge.NodeType.SOURCE,
i );
+            final IndexEdge indexEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE,
i );
 
             Thread thread = new Thread( () -> {
                 try {
 
 
-
                     EntityIndexBatch batch = entityIndex.createBatch();
                     insertJsonBlob( sampleJson, batch, entityType, indexEdge, size, 0 );
                     batch.execute().get();
@@ -238,7 +270,7 @@ public class EntityIndexTest extends BaseIT {
 
 
         final String entityType = "thing";
-        IndexEdge searchEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE,
 10 );
+        IndexEdge searchEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE,
10 );
         final SearchTypes searchTypes = SearchTypes.fromTypes( entityType );
 
         insertJsonBlob( entityIndex, entityType, searchEdge, "/sample-large.json", 101, 0
);
@@ -270,7 +302,7 @@ public class EntityIndexTest extends BaseIT {
 
 
         final String entityType = "thing";
-        IndexEdge searchEdge = new IndexEdgeImpl( appId, "things",  SearchEdge.NodeType.SOURCE,
1 );
+        IndexEdge searchEdge = new IndexEdgeImpl( appId, "things", SearchEdge.NodeType.SOURCE,
1 );
         final SearchTypes searchTypes = SearchTypes.fromTypes( entityType );
 
         insertJsonBlob( entityIndex, entityType, searchEdge, "/sample-large.json", 1, 0 );
@@ -350,7 +382,7 @@ public class EntityIndexTest extends BaseIT {
 
         ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
 
-        IndexEdge searchEdge = new IndexEdgeImpl( appId, "fastcars", SearchEdge.NodeType.SOURCE,
 1 );
+        IndexEdge searchEdge = new IndexEdgeImpl( appId, "fastcars", SearchEdge.NodeType.SOURCE,
1 );
 
         ApplicationEntityIndex entityIndex = eif.createApplicationEntityIndex( applicationScope
);
 
@@ -487,7 +519,7 @@ public class EntityIndexTest extends BaseIT {
 
         ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
 
-        IndexEdge indexSCope = new IndexEdgeImpl( ownerId, "user",  SearchEdge.NodeType.SOURCE,
10 );
+        IndexEdge indexSCope = new IndexEdgeImpl( ownerId, "user", SearchEdge.NodeType.SOURCE,
10 );
 
         ApplicationEntityIndex entityIndex = eif.createApplicationEntityIndex( applicationScope
);
 
@@ -536,7 +568,7 @@ public class EntityIndexTest extends BaseIT {
         Id ownerId = new SimpleId( "multivaluedtype" );
         ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
 
-        IndexEdge indexScope = new IndexEdgeImpl( ownerId, "user",  SearchEdge.NodeType.SOURCE,
10 );
+        IndexEdge indexScope = new IndexEdgeImpl( ownerId, "user", SearchEdge.NodeType.SOURCE,
10 );
 
         ApplicationEntityIndex entityIndex = eif.createApplicationEntityIndex( applicationScope
);
 
@@ -622,7 +654,7 @@ public class EntityIndexTest extends BaseIT {
 
         ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
 
-        IndexEdge indexEdge = new IndexEdgeImpl( ownerId, "users",  SearchEdge.NodeType.SOURCE,
10 );
+        IndexEdge indexEdge = new IndexEdgeImpl( ownerId, "users", SearchEdge.NodeType.SOURCE,
10 );
 
 
         ApplicationEntityIndex entityIndex = eif.createApplicationEntityIndex( applicationScope
);
@@ -688,13 +720,14 @@ public class EntityIndexTest extends BaseIT {
 
             assertEquals( "Should be 16 bytes as hex", 32, cursor.length() );
 
-
             assertEquals( 1, results.size() );
 
 
             assertEquals( results.get( 0 ).getId(), entities.get( i ) );
         }
     }
+
+
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
new file mode 100644
index 0000000..f8ec28e
--- /dev/null
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
@@ -0,0 +1,158 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *    http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+package org.apache.usergrid.persistence.index.impl;
+
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
+import org.apache.usergrid.persistence.core.test.UseModules;
+import org.apache.usergrid.persistence.index.ApplicationEntityIndex;
+import org.apache.usergrid.persistence.index.CandidateResult;
+import org.apache.usergrid.persistence.index.CandidateResults;
+import org.apache.usergrid.persistence.index.EntityIndex;
+import org.apache.usergrid.persistence.index.EntityIndexBatch;
+import org.apache.usergrid.persistence.index.EntityIndexFactory;
+import org.apache.usergrid.persistence.index.IndexEdge;
+import org.apache.usergrid.persistence.index.SearchEdge;
+import org.apache.usergrid.persistence.index.SearchTypes;
+import org.apache.usergrid.persistence.index.guice.TestIndexModule;
+import org.apache.usergrid.persistence.index.utils.UUIDUtils;
+import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.model.field.IntegerField;
+import org.apache.usergrid.persistence.model.field.LocationField;
+import org.apache.usergrid.persistence.model.field.StringField;
+import org.apache.usergrid.persistence.model.field.value.Location;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import com.google.inject.Inject;
+
+import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+
+/**
+ * // TODO: Document this
+ *
+ * @author ApigeeCorporation
+ * @since 4.0
+ */
+
+@RunWith( EsRunner.class )
+@UseModules( { TestIndexModule.class } )
+public class GeoPagingTest extends BaseIT {
+    private static Logger log = LoggerFactory.getLogger( GeoPagingTest.class );
+
+    @Inject
+    public EntityIndexFactory eif;
+
+    @Inject
+    public EntityIndex ei;
+
+    @Inject
+    @Rule
+    public MigrationManagerRule migrationManagerRule;
+
+
+    @Before
+    public void setup() {
+        ei.initialize();
+    }
+
+
+
+    /**
+     * Test that geo-query returns co-located entities in expected order.
+     */
+    @Test
+    public void groupQueriesWithDistanceOrderedResults() throws IOException {
+
+        int maxRangeLimit = 9;
+        Entity[] cats = new Entity[maxRangeLimit + 1];
+
+        final ApplicationEntityIndex
+                applicationEntityIndex = eif.createApplicationEntityIndex( new ApplicationScopeImpl(
createId( "application" ) ) );
+
+        final EntityIndexBatch batch = applicationEntityIndex.createBatch();
+
+
+        final IndexEdge edge = new IndexEdgeImpl(createId("root"), "testType", SearchEdge.NodeType.SOURCE,
 1000  );
+
+        //Create several entities, saved in reverse order so we have highest time UUID as
"closest" to ensure that
+        //our geo order works correctly
+        for ( int i = maxRangeLimit; i >= 0; i-- ) {
+            Entity cat = new Entity("cat");
+            EntityUtils.setVersion( cat, UUIDGenerator.newTimeUUID() );
+
+
+            cat.setField( new StringField("name", "cat" + i ));
+            cat.setField( new LocationField("location", new Location(37.0 + i ,  -75.0 +
i ) ) );
+            cats[i] = cat;
+
+            batch.index( edge, cat );
+
+        }
+
+        batch.execute();
+        ei.refresh();
+
+
+        final String query =  "select * where location within 1500000 of 37, -75" ;
+
+        final CandidateResults
+                candidates = applicationEntityIndex.search( edge, SearchTypes.fromTypes(
"cat" ), query, 100 );
+
+        assertNotNull( candidates );
+
+
+        for ( int consistent = 0; consistent < maxRangeLimit; consistent++ ) {
+            //got entities back, just need to page through them and make sure that i got
them in location order.
+            CandidateResult candidate = candidates.get( consistent );
+            assertNotNull( candidate );
+
+
+            final Entity expected = cats[consistent];
+            assertEquals(expected.getId(), candidate.getId());
+
+
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
index 8b928ce..3dedcae 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
@@ -104,9 +104,6 @@ public class IndexLoadTestsIT extends BaseIT {
     public EntityIndexFactory entityIndexFactory;
 
     @Inject
-    public EntityIndex entityIndex;
-
-    @Inject
     public MetricsFactory metricsFactory;
 
     private Meter batchWriteTPS;
@@ -130,7 +127,6 @@ public class IndexLoadTestsIT extends BaseIT {
         final UUID applicationUUID = UUID.fromString( userAppId );
 
         final Id applicationId = new SimpleId( applicationUUID, "application" );
-        final ApplicationScope scope = new ApplicationScopeImpl( applicationId );
 
 
         batchWriteTPS = metricsFactory.getMeter( IndexLoadTestsIT.class, "write.tps" );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/resources/log4j.properties b/stack/corepersistence/queryindex/src/test/resources/log4j.properties
index c66b139..b193f33 100644
--- a/stack/corepersistence/queryindex/src/test/resources/log4j.properties
+++ b/stack/corepersistence/queryindex/src/test/resources/log4j.properties
@@ -37,9 +37,9 @@ log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) %c{1} - %m%n
 #log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG, stdout
 
 #Debug our queries
-log4j.logger.org.apache.usergrid.persistence.index.impl.EsApplicationEntityIndexImpl=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.index.impl.EsApplicationEntityIndexImpl=DEBUG
 #Debug our writes
-log4j.logger.org.apache.usergrid.persistence.index.impl.EsIndexBufferConsumerImpl=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.index.impl.EsIndexBufferConsumerImpl=DEBUG
 #Batch debugging
-log4j.logger.org.apache.usergrid.persistence.index.impl.EsEntityIndexBatchImpl=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.index.impl.EsEntityIndexBatchImpl=DEBUG
 log4j.logger.org.apache.usergrid=INFO

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queryindex/src/test/resources/test.json
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/resources/test.json b/stack/corepersistence/queryindex/src/test/resources/test.json
deleted file mode 100644
index b13c153..0000000
--- a/stack/corepersistence/queryindex/src/test/resources/test.json
+++ /dev/null
@@ -1,133 +0,0 @@
-{
-  "entityVersion": "f6928d60-dd71-11e4-8fcf-c6c6eebe8d56",
-  "edgeNodeId": "f64f69cc-dd71-11e4-8fcf-c6c6eebe8d56_application",
-  "edgeName": "things",
-  "entityType": "f64f69cc-dd71-11e4-8fcf-c6c6eebe8d56_application__thing",
-  "edgeType": "SOURCE",
-  "edgeTimestamp": 1,
-  "edgeSearch": "f64f69cc-dd71-11e4-8fcf-c6c6eebe8d56_application__f64f69cc-dd71-11e4-8fcf-c6c6eebe8d56_application__things__SOURCE",
-  "entityId": "f6928d5f-dd71-11e4-8fcf-c6c6eebe8d56_thing",
-  "applicationId": "f64f69cc-dd71-11e4-8fcf-c6c6eebe8d56_application",
-  "fields": [
-    {
-      "name": "gender",
-      "string": "female"
-    },
-    {
-      "name": "latitude",
-      "double": 47.3984
-    },
-    {
-      "name": "about",
-      "string": "cupidatat est elit fugiat eu non lorem ea sunt eu lorem. lorem elit commodo
pariatur labore velit cillum id officia anim aliquip. proident sunt consectetur laborum ullamco
nisi excepteur sit laborum. id cillum nulla esse eiusmod non exercitation deserunt incididunt
eu cupidatat sit proident labore. do dolor culpa sunt esse esse voluptate minim eiusmod in
deserunt incididunt.\r\n"
-    },
-    {
-      "name": "registered",
-      "string": "1994-06-05t10:31:45 +04:00"
-    },
-    {
-      "name": "isActive",
-      "boolean": true
-    },
-    {
-      "name": "picture",
-      "string": "http://placehold.it/32x32"
-    },
-    {
-      "name": "friends.name",
-      "string": "boyle davis"
-    },
-    {
-      "name": "friends.id",
-      "int": 0
-    },
-    {
-      "name": "friends.name",
-      "string": "cassandra morales"
-    },
-    {
-      "name": "friends.id",
-      "int": 1
-    },
-    {
-      "name": "friends.name",
-      "string": "jolene olson"
-    },
-    {
-      "name": "friends.id",
-      "int": 2
-    },
-    {
-      "name": "tags",
-      "string": "aliquip"
-    },
-    {
-      "name": "tags",
-      "string": "voluptate"
-    },
-    {
-      "name": "tags",
-      "string": "nostrud"
-    },
-    {
-      "name": "tags",
-      "string": "ullamco"
-    },
-    {
-      "name": "tags",
-      "string": "deserunt"
-    },
-    {
-      "name": "tags",
-      "string": "quis"
-    },
-    {
-      "name": "tags",
-      "string": "qui"
-    },
-    {
-      "name": "balance",
-      "string": "$3,498.00"
-    },
-    {
-      "name": "randomArrayItem",
-      "string": "cherry"
-    },
-    {
-      "name": "contact.address",
-      "string": "843 bath avenue, sanders, alabama, 7969"
-    },
-    {
-      "name": "contact.phone",
-      "string": "+1 (846) 498-2864"
-    },
-    {
-      "name": "contact.email",
-      "string": "minervaharrell@isis.com"
-    },
-    {
-      "name": "name",
-      "string": "minerva harrell"
-    },
-    {
-      "name": "guid",
-      "string": "e377f195-58c7-46d1-b9ff-28fd0391e222"
-    },
-    {
-      "name": "company",
-      "string": "isis"
-    },
-    {
-      "name": "id",
-      "int": 9
-    },
-    {
-      "name": "age",
-      "int": 40
-    },
-    {
-      "name": "longitude",
-      "double": -81.830573
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05c27647/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
index 197b791..c1d84db 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
@@ -8,6 +8,14 @@ import org.safehaus.guicyfig.Key;
 @FigSingleton
 public interface QueueFig extends GuicyFig {
 
+    /**
+     * This value comes from this page
+     *
+     * http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html
+     *
+     * The string here must match the region on this documentation page
+     * @return
+     */
     @Key( "usergrid.queue.region" )
     @Default("us-east-1")
     public String getRegion();


Mime
View raw message