title: Search highlight in Elasticsearch (javascript)
body: <p>I am having a problem with result highlighting in Elasticsearch. My query works, it does return results, but they are NOT highlighted... so I've been searching but I can't find what I'm doing wrong!</p>
  
  <p>This is my code:</p>
  
  <pre><code>function search(searchInput){
      emptyTable();
      client.search({
          index: 'movies',
          size: 5,
          body: {
              query: {
                  //match: {_all: searchInput}
                  "term": {
                      "_all" : searchInput                
                  }
              },
              "highlight": {
              "require_field_match": true,
              "fields": {
                  "_all": {
                      "pre_tags": [
                          "&lt;b&gt;"
                      ],
                      "post_tags": [
                          "&lt;/b&gt;"
                      ]
                  }
              }
          }
          }
      }).then(function (resp) {
          var hits = resp.hits.hits;
          var hitcount = resp.hits.total;
          if(!jQuery.isEmptyObject(hits)){
              console.log(hits);
              $.each(hits, function(key,obj) {                        
                  if(key%2==0){
                      $('#table').append('&lt;tr&gt;&lt;td&gt;'+obj._source.imdbid+'&lt;/td&gt;&lt;td&gt;'+obj._source.name+'&lt;/td&gt;&lt;td&gt;'+obj._source.desc+'&lt;/td&gt;&lt;/tr&gt;');
                  }else{
                      $('#table').append('&lt;tr class="even"&gt;&lt;td&gt;'+obj._source.imdbid+'&lt;/td&gt;&lt;td&gt;'+obj._source.name+'&lt;/td&gt;&lt;td&gt;'+obj._source.desc+'&lt;/td&gt;&lt;/tr&gt;');              
                  }
              }); 
          }
          $('#count').html("Aantal resultaten: "+hitcount);
      });
  }
  </code></pre>
  
  <p>I am searching data then putting it in a table, works fine. But the highlighting is not working at all. Please help me out!</p>