Search code examples
elasticsearchstoragetokenterm-vectors

When storing term vectors is the parameter "store" mandatory?


I want to store term vectors of a field but I have doubt in my mind. In the documentation they say:

"mappings": {
    "tweet": {
      "properties": {
        "text": {
          "type": "text",
          "term_vector": "with_positions_offsets_payloads",
          "store" : true,
          "analyzer" : "fulltext_analyzer"
         }
      }
    }
  }

Will store the term vectors. But the term vectors are accessible only through a certain endpoint:

/twitter/tweet/1/_termvectors

And what will be stored is the field text. So what if I want to store my term vectors but not the field text. Will it store the term vectors if I don't specify "store":true? How can I be sure my term vectors are stored and not computed on the fly?


Solution

  • The term vectors will be stored when you have term_vector specified in the mapping (with any of the possible options except no of course). See the term_vector docs -- the example mapping there does not include "store":true, and the docs specifically say the term vector will be stored.