title: Extract keywords (multi word) from text using elastic search
body: <p>I have an index full of keywords and based on those keywords I want to extract the keywords from the input text.</p>
  
  <p>Following is the sample keyword index. Please note that the keywords can be of multiple words too, or basically they are tags which are unique.</p>
  
  <pre><code>{
    "hits": {
      "total": 2000,
      "hits": [
        {
          "id": 1,
          "keyword": "thousand eyes"
        },
        {
          "id": 2,
          "keyword": "facebook"
        },
        {
          "id": 3,
          "keyword": "superdoc"
        },
        {
          "id": 4,
          "keyword": "quora"
        },
        {
          "id": 5,
          "keyword": "your story"
        },
        {
          "id": 6,
          "keyword": "Surgery"
        },
        {
          "id": 7,
          "keyword": "lending club"
        },
        {
          "id": 8,
          "keyword": "ad roll"
        },
        {
          "id": 9,
          "keyword": "the honest company"
        },
        {
          "id": 10,
          "keyword": "Draft kings"
        }
      ]
    }
  }
  </code></pre>
  
  <p>Now, if I input the text as <strong>"I saw the news of lending club on facebook, your story and quora"</strong> the output of the search should be <strong>["lending club", "facebook", "your story", "quora"]</strong>. Also the search should be <strong>case insensetive</strong></p>