Github user snoopdave commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/112#discussion_r21322936
  
    --- Diff: 
stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
 ---
    @@ -151,69 +151,99 @@ public static XContentBuilder 
createDoubleStringIndexMapping(
     
                     .startObject( type )
     
    +                    // don't store source object in ES 
    +                    .field("_source") 
    --- End diff --
    
    Once a mapping is created for a type you can only add to it [1].  In UG2 we 
use a default mapping template so that all types get the same mappings. When a 
new type is created, e.g. when a new UG collection is added, ES will create a 
mapping for it based on the default mapping template. Once that happens, we 
cannot change the things specified by the mapping.
    
    That means that, once an type is created the only way to change from "store 
source" to "do not store source" is to, for each type, delete the old mapping, 
create the new mapping and then re-index all data of the type.
    
    I think I should delete the migration code I have written so far for this 
and instead, check our re-build index logic to make sure it deletes mappings 
for each type before it re-indexes the type.
    
    [1] From ElasticSearch: The Definitive Guide, p. 93 in section "Updating a 
Mapping"
    
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to