# How to obtain termvectors api results for a multi-fields text?

**URL:** https://discuss.elastic.co/t/how-to-obtain-termvectors-api-results-for-a-multi-fields-text/66527
**Category:** Elasticsearch
**Created:** [November 18, 2016, 11:22am UTC](https://discuss.elastic.co/t/how-to-obtain-termvectors-api-results-for-a-multi-fields-text/66527 "2016-11-18T11:22:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vchalmel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vchalmel/32/11681_2.png) [@vchalmel](https://discuss.elastic.co/u/vchalmel)
#### Post date: [November 18, 2016, 11:22am UTC](https://discuss.elastic.co/t/how-to-obtain-termvectors-api-results-for-a-multi-fields-text/66527/1 "2016-11-18T11:22:38Z")

</div>

I can't figure out the syntax to get the termvectors details for a multi-field text  
here is my mapping :

```
fiche_es": {
  "properties": {
    "es_article": {
      "type": "nested",
        "properties": {
          "ar_titre": {
            "analyzer": "analyse_mots_clefs_combines",
            "type": "string",
            "fields": {
                 "search": {
                      "similarity": "BM25",
                      "analyzer": "analyse_texte_libre",
                      "term_vector": "with_positions_offsets",
                      "type": "string"
                 },
                 "raw": {
                      "similarity": "BM25",
                      "analyzer": "analyse_mots_clefs",
                      "term_vector": "with_positions_offsets",
                      "type": "string"
                 }
             }
       }
...

```

how can I get the term vector for es\_article.ar\_titre.search ?  
This code

```
curl -XPOST 'http://host/index/fiche_es/<id>/_termvectors' -d '{
  "fields": [
    "es_article.ar_article.search"
  ]
}'

```

fails, while this one

```
curl -XPOST 'http://host/index/fiche_es/<id>/_termvectors' -d '{
  "fields": [
    "es_article.ar_article"
  ]
}'

```

returns the result for the "root" of the field, which have its own analyzer, and not the multi-fields

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 16, 2016, 11:22am UTC](https://discuss.elastic.co/t/how-to-obtain-termvectors-api-results-for-a-multi-fields-text/66527/2 "2016-12-16T11:22:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
