title: Spring Data Elasticsearch: Datas are stored in indexes despite "store" property is setted to false in @Field annotation
body: <p>I'm making some tests with Spring Data Elasticsearch, Spring Boot, Spring Data Rest and an h2 Database (embedded).</p>
  
  <p>I don't understand why the values are stored in the indexes despite I have this configuration:</p>
  
  <pre><code>@Entity
  @Document(indexName = "computerindex", type="computers")
  public class Computer {
  
      @Id
      @GeneratedValue(generator="system-uuid")
      @GenericGenerator(name="system-uuid", strategy = "uuid")
      private String id;
      @Field(type=FieldType.String, store=false) private String name; 
      @Field(type=FieldType.String, store=false) private String brand;
  
  }
  
  @Configuration
  @EnableWebMvc
  @EnableJpaRepositories
  @EnableElasticsearchRepositories
  public class ElasticSearchConfig {
      @Bean
      public ElasticsearchTemplate elasticsearchTemplate() throws IOException {
          return new ElasticsearchTemplate(getNodeClient());
      }
  
      private static NodeClient getNodeClient() throws IOException {
          String pathHome = new File(".").getCanonicalPath();
          NodeBuilder nodeBuilder = new NodeBuilder();
          nodeBuilder
              .settings()
                  .put("path.home", pathHome)
                  .put("path.logs", pathHome+"/logs");
          return (NodeClient) nodeBuilder.clusterName("elasticsearch").local(true).node().client();
      }
  }
  </code></pre>
  
  <p>Going to the url <code>http://localhost:8080/computers</code>, initially there is an <strong>empty "_embedded" result</strong> (as expected):</p>
  
  <pre><code>{
    "_embedded" : {
      "computers" : [ ]
    },
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/computers"
      },
      "profile" : {
        "href" : "http://localhost:8080/profile/computers"
      },
      "search" : {
        "href" : "http://localhost:8080/computers/search"
      }
    },
    "page" : {
      "size" : 20,
      "totalElements" : 0,
      "totalPages" : 0,
      "number" : 0
    }
  }
  </code></pre>
  
  <p>When I save a new "Computer", I have this result:</p>
  
  <pre><code>{
    "_embedded" : {
      "computers" : [ {
        "name" : "pc",
        "brand" : "brand",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/computers/AVZZwpMlqIneBcTGH3av"
          },
          "computer" : {
            "href" : "http://localhost:8080/computers/AVZZwpMlqIneBcTGH3av"
          }
        }
      } ]
    },
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/computers"
      },
      "profile" : {
        "href" : "http://localhost:8080/profile/computers"
      },
      "search" : {
        "href" : "http://localhost:8080/computers/search"
      }
    },
    "page" : {
      "size" : 20,
      "totalElements" : 1,
      "totalPages" : 1,
      "number" : 0
    }
  }
  </code></pre>
  
  <p>Now there is the interesting part.</p>
  
  <p>If I stop the application and I restart it (without erase the indexes), since I have an embedded H2 database that runs and lives together with my application, I will expect that my "pc" is lost after that 
  the previous session has been terminated.</p>
  
  <p>The indexes are also configured <strong>to not store any data</strong>.</p>
  
  <p>When I restart the application, I still have this result:</p>
  
  <pre><code>"computers" : [ {
    "name" : "pc",
    "brand" : "brand",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/computers/AVZZwpMlqIneBcTGH3av"
      },
      "computer" : {
        "href" : "http://localhost:8080/computers/AVZZwpMlqIneBcTGH3av"
      }
    }
  </code></pre>
  
  <p>The only explanation could be that the values are <em>restored</em> from the indexes: in fact, if I delete the indexes before restarting the application, I have an empty database (as I expect).
  But <strong>I don't want to save the data in the indexes</strong>, and <strong>I don't want that the datas are pulled from the indexes</strong>.
  Furthermore, I have explicitely configured <code>store=false</code>, and <strong>I didn't set</strong> the <code>data(true)</code> property (like this):</p>
  
  <pre><code>return (NodeClient) nodeBuilder.clusterName("elasticsearch").local(true).data(true).node().client();
  </code></pre>
  
  <p>Any ideas?</p>