title: Spring data elastic search - Query - Full text search
body: <p>I am trying to use elastic search for full text search and Spring data for integrating elastic search with my application.</p>
  
  <p>For example,</p>
  
  <p>There are 6 fields to be indexed.</p>
  
  <p>1)firstName
   2)lastName
   3)title
   4)location
   5)industry
   6)email </p>
  
  <p><a href="http://localhost:9200/test/_mapping/" rel="nofollow noreferrer">http://localhost:9200/test/_mapping/</a></p>
  
  <p>I can see these fields in the mapping.</p>
  
  <p>Now, I would like to make a search against these fields with a search input.</p>
  
  <p>For example, When I search "mike 123", it has to search against all these 6 fields.</p>
  
  <p>In Spring data repository,</p>
  
  <p>The below method works to search only in firstName.</p>
  
  <pre><code>Collection&lt;Object&gt; findByFirstNameLike(String searchInput)
  </code></pre>
  
  <p>But, I would like to search against all the fields.</p>
  
  <p>I tried,</p>
  
  <pre><code>Collection&lt;Object&gt; findByFirstNameLikeOrLastNameLikeOrTitleLikeOrLocationLikeOrIndustryLikeOrEmailLike(String searchInput,String searchInput1,String searchInput2,String searchInput3,)
  </code></pre>
  
  <p>Here, even the input string is same, i need to pass the same input as 6 params. Also the method name looks bigger with multiple fields.</p>
  
  <p>Is there anyway to make it simple with @Query or ....</p>
  
  <p>Like,</p>
  
  <pre><code>Collection&lt;Object&gt; findByInput(String inputString)
  </code></pre>
  
  <p>Also, boosting should be given for one of the field.</p>
  
  <p>For example,</p>
  
  <p>When i search for "mike mat", if there is any match in the firstName, that should be the first one in the result even there are exact match in the other fields.</p>
  
  <p>Thanks</p>