title: ElasticSearch search by _source fields
body: <p>I have a requirement to implement a search engine. Like google / yahoo search, In a search component if any key entered it should find the matches and displayed. For this requirement i have created Spring Boot Project integrated with elastic search. </p>
  
  <p>Using logstash i created index for my Oracle database in Elastic search., By using below code am able to fetch records based on Elastic Search Index id.</p>
  
  <pre><code>private final String INDEX = "bookdata";
  private final String TYPE = "books";
  
  public Map&lt;String, Object&gt; getBookById(String id){
      GetRequest getRequest = new GetRequest(INDEX, TYPE, id);
      GetResponse getResponse = null;
      try {
          getResponse = restHighLevelClient.get(getRequest);
      } catch (java.io.IOException e){
          e.getLocalizedMessage();
      }
      Map&lt;String, Object&gt; sourceAsMap = getResponse.getSourceAsMap();
      return sourceAsMap;
  }
  </code></pre>
  
  <p>The above code is working fine and am able to fetch Book based on <code>ID</code>. But i have to Author or Title of the book.</p>
  
  <p>Please find my indexed documents in Elastic search from Kibana</p>
  
  <pre><code>{
    "took": 34,
    "timed_out": false,
    "_shards": {
      "total": 5,
      "successful": 5,
      "skipped": 0,
      "failed": 0
    },
    "hits": {
      "total": 3,
      "max_score": 1,
      "hits": [
        {
          "_index": "bookdata",
          "_type": "books",
          "_id": "72c58f1a-7bfe-41be-a7f4-ee0aca3f4cf4",  //able to search by ID
          "_score": 1,
          "_source": {
            "id": "72c58f1a-7bfe-41be-a7f4-ee0aca3f4cf4",
            "title": "Java Always",  // want to search by Title
            "author": "JournalDev", // or want to search by author
            "price": 99.1
          }
        }
  }
  </code></pre>
  
  <p>Am not very sure, how can in search with Author or Title of the book.</p>