Merge branch 'two-dot-o-dev' into USERGRID-744
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ApplicationIndexLocationStrategy.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ApplicationIndexLocationStrategy.java
index c75eac3..fcfb09b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ApplicationIndexLocationStrategy.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ApplicationIndexLocationStrategy.java
@@ -53,7 +53,7 @@
         this.applicationIndexBucketLocator = applicationIndexBucketLocator;
         this.indexRootName  = clusterFig.getClusterName() + "_" + cassandraFig.getApplicationKeyspace().toLowerCase();
         this.alias =  new ApplicationIndexAlias(indexFig, applicationScope, indexRootName);
-        this.indexBucketName = indexRootName + "_" + applicationIndexBucketLocator.getBucket(applicationScope);
+        this.indexBucketName = indexRootName + "_applications_" + applicationIndexBucketLocator.getBucket(applicationScope);
     }
 
 
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/IndexNamingTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/IndexNamingTest.java
index ee51154..2d77697 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/IndexNamingTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/IndexNamingTest.java
@@ -155,7 +155,7 @@
                 );
             names.add(indexLocationStrategyBucket.getIndexInitialName());
         }
-        Pattern regex = Pattern.compile(clusterName+"_"+keyspacename+"_\\d+");
+        Pattern regex = Pattern.compile(clusterName+"_"+keyspacename+"_applications_\\d+");
         //always hashes to same bucket
         assertTrue(names.size() == 1);
         names = new HashSet<>();
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guicyfig/ClusterFig.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guicyfig/ClusterFig.java
index a0c3f38..2793894 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guicyfig/ClusterFig.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guicyfig/ClusterFig.java
@@ -31,7 +31,7 @@
 public interface ClusterFig extends GuicyFig{
 
     @Default( "ug" )
-    @Key( "elasticsearch.index_prefix" ) //"usergrid.cluster_name"
+    @Key( "usergrid.cluster_name" ) //"usergrid.cluster_name"
     String getClusterName();
 
 }
diff --git a/stack/corepersistence/queryindex/README.md b/stack/corepersistence/queryindex/README.md
index cb96aa1..2e5745b 100644
--- a/stack/corepersistence/queryindex/README.md
+++ b/stack/corepersistence/queryindex/README.md
@@ -1,17 +1,17 @@
 Core Persistence Query Index Module
 ===
-This module defines an __EntityCollectionIndex__ interface for indexing, de-indexing and querying Entities within a Collection. Queries are expressed in Usergrid's SQL-like query syntax. 
+This module defines an __EntityCollectionIndex__ interface for indexing, de-indexing and querying Entities within a Collection. Queries are expressed in Usergrid's SQL-like query syntax.
 
 Implementation
 ---
-This module also provides an implementation of the EntityCollectionIndex using the open source ElasticSearch as index and query engine. 
+This module also provides an implementation of the EntityCollectionIndex using the open source ElasticSearch as index and query engine.
 
 Here are the important parts of the QueryIndex module:
 
-* __EntityCollectionIndex__: the interface that defines methods for indexing, deindexing and querying an index. 
+* __EntityCollectionIndex__: the interface that defines methods for indexing, deindexing and querying an index.
 * __EntityCollectionIndexFactory__: factory for obtaining an index for an Entity Collection.
 * __IndexFig__: defines configuration needed for this module to operate.
-* __org.apache.usergrid.persistence.index.impl__: provides an implementation using ElasticSearch via its Java API. 
+* __org.apache.usergrid.persistence.index.impl__: provides an implementation using ElasticSearch via its Java API.
 * __Query, Results and EntityRefs__: these classes were "ported" from Usergrid 1.0 to support Usergrid query syntax. We define a grammar and use ANTLR to generate a parser and a lexer.
 
 100 Legacy Tests
@@ -45,3 +45,14 @@
     * Smaller indexes means quicker queries?
 * For each index, how many shards? The default five is good enough?
     * The number of shards = the maximum number of nodes possible
+
+Naming Configuration
+---
+clusterName = config{usergrid.cluster_name}
+keyspaceName = config{cassandra.keyspace.application}
+managementName = config{elasticsearch.managment_index}
+indexRoot = {clusterName}_{keyspaceName}
+managementIndexName = {indexRoot}_{managementName}
+managementAliasName = {indexRoot}_{managementName}_read_alias || {indexRoot}_{managementName}_read_alias
+applicationIndexName = {indexRoot}_applications_{bucketId}
+applicationAliasName = {indexRoot}_{appId}_read_alias || {indexRoot}_{appId}_write_alias