title: Elasticsearch: getting the tf-idf of every term in a given document
body: <p>I have a document in my elasticsearch with the following id: <code>AVosj8FEIaetdb3CXpP-</code> I'm trying to access for every words in the fields it's tf-idf I did the following:</p>
  
  <pre><code>GET /cnn/cnn_article/AVosj8FEIaetdb3CXpP-/_termvectors
  {
    "fields" : ["author_wording"],
    "term_statistics" : true,
    "field_statistics" : true
  }'
  </code></pre>
  
  <p>The response I've got is:</p>
  
  <pre><code>{
    "_index": "dailystormer",
    "_type": "dailystormer_article",
    "_id": "AVosj8FEIaetdb3CXpP-",
    "_version": 3,
    "found": true,
    "took": 1,
    "term_vectors": {
      "author_wording": {
        "field_statistics": {
          "sum_doc_freq": 3408583,
          "doc_count": 16111,
          "sum_ttf": 7851321
        },
        "terms": {
          "318": {
            "doc_freq": 4,
            "ttf": 4,
            "term_freq": 1,
            "tokens": [
              {
                "position": 121,
                "start_offset": 688,
                "end_offset": 691
              }
            ]
          },
          "742": {
            "doc_freq": 1,
            "ttf": 1,
            "term_freq": 1,
            "tokens": [
              {
                "position": 122,
                "start_offset": 692,
                "end_offset": 695
              }
            ]
          },
          "9971": {
            "doc_freq": 1,
            "ttf": 1,
            "term_freq": 1,
            "tokens": [
              {
                "position": 123,
                "start_offset": 696,
                "end_offset": 700
              }
            ]
          },
          "a": {
            "doc_freq": 14921,
            "ttf": 163268,
            "term_freq": 11,
            "tokens": [
              {
                "position": 1,
                "start_offset": 13,
                "end_offset": 14
              },
              ...
              "you’re": {
            "doc_freq": 1112,
            "ttf": 1647,
            "term_freq": 1,
            "tokens": [
              {
                "position": 80,
                "start_offset": 471,
                "end_offset": 477
              }
            ]
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>It returns me some interesting fields like the term frequency (tf) but not the tf-idf. Should I recompute it myself? Is that a good idea? How can I do so?</p>