title: Spring Data Elasticsearch only returning exact matches
body: <p>I made a simple project to test <code>free text search</code> using Spring Data Elasticsearch. Here is my entity:</p>
  
  <pre><code>@Document(indexName = "flag", type = "flag")
  public class Flag {
  
      @Id
      private String flagCode;
  
      @MultiField(mainField = @Field(type = FieldType.String))
      private String flagName;
  
      // setters and getters
  }
  </code></pre>
  
  <p>Now, my search operation looks like:</p>
  
  <pre><code>SearchQuery searchQuery = new NativeSearchQueryBuilder()
              .withQuery(fuzzyQuery("flagName", freeText))
              .build();
  List&lt;Flag&gt; flags =  elasticsearchTemplate.queryForList(searchQuery, Flag.class);
  </code></pre>
  
  <p>With this, I am only getting objects whose <code>flagName</code> is exact match to <code>flagName</code> where as I want that if at least 2 characters match, it should be a <strong>match</strong>.</p>
  
  <p>If relevant, my <code>DataConfig</code> file looks like:</p>
  
  <pre><code>@Configuration
  @EnableElasticsearchRepositories(basePackages = "com.shubham.dao")
  @ComponentScan(basePackages = "com.shubham.data")
  public class DataConfig {
  
      @Value("${elasticsearch.clustername}")
      private String clusterName;
  
      @Value("${elasticsearch.host}")
      private String elasticsearchHost;
  
      @Value("${elasticsearch.port}")
      private int elasticsearchPort;
  
      @Bean
      public Client client() throws Exception {
  
      Settings esSettings = Settings.settingsBuilder()
              .put("cluster.name", clusterName)
              .build();
  
      //https://www.elastic.co/guide/en/elasticsearch/guide/current/_transport_client_versus_node_client.html
      return TransportClient.builder()
              .settings(esSettings)
              .build()
              .addTransportAddress(
                      new InetSocketTransportAddress(InetAddress.getByName(elasticsearchHost), elasticsearchPort));
      }
  
      @Bean
      public ElasticsearchOperations elasticsearchTemplate() throws Exception {
          return new ElasticsearchTemplate(client());
      }
  }
  </code></pre>
  
  <p>What am I possibly doing wrong? I am newbie to Elasticsearch.</p>