# Term Vectors in Nested Documents

**URL:** https://discuss.elastic.co/t/term-vectors-in-nested-documents/31556
**Category:** Elasticsearch
**Created:** [October 2, 2015, 4:36pm UTC](https://discuss.elastic.co/t/term-vectors-in-nested-documents/31556 "2015-10-02T16:36:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![karshan](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@karshan](https://discuss.elastic.co/u/karshan)
#### Post date: [October 2, 2015, 4:36pm UTC](https://discuss.elastic.co/t/term-vectors-in-nested-documents/31556/1 "2015-10-02T16:36:55Z")

</div>

Hi I am not able to get the term vectors to work with nested documents. Not sure if my Mapping is right. Pls find the mapping below.

I get an error - No handler found for uri [/test-vector/doc/1/\_termvectors?pretty=true] and method [GET], when i issue - GET test-vector/doc/1/\_termvectors?pretty=true

```
PUT /_template/template_vector_test
{
    "template":"test-vector",
    "settings": 
    {
		"analysis": 
		{
			"tokenizer": 
			{
				"ngram_tokenizer": 
				{
					"type": "nGram",
					"min_gram": 3,
					"max_gram": 8
				}
			},
			"analyzer": 
			{
				"ngram_tokenizer_analyzer": 
				{
					"type": "custom",
					"tokenizer": "ngram_tokenizer",
					"filter": ["lowercase"]
				}
			}
		}
   },
   "mappings": 
    {
	    "doc": 
        {
            "dynamic":"false",
            "_timestamp":{"enabled": "true","store":"true","format":"YYYY-MM-DD HH:mm:ss.SSS","default":"now"},
            "properties":
            {
				"book":
				{
					"type":"object",
					"properties":
					{
						"details":
						{
							"type":"object",
							"properties":
							{
								"comment":
								{
									"type":"string",
									"term_vector":"yes",
									"analyzer": "ngram_tokenizer_analyzer"
								}
							}
						}
					}
				}
            }    
        }
    }
}

```

Thanks  
Shankar

---

<div class="post-metadata">

### Author: ![karshan](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@karshan](https://discuss.elastic.co/u/karshan)
#### Post date: [October 8, 2015, 1:12pm UTC](https://discuss.elastic.co/t/term-vectors-in-nested-documents/31556/2 "2015-10-08T13:12:45Z")

</div>

Duh!! there was a typo in the term vector command. I got this to work!

---

<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: [July 5, 2017, 11:45pm UTC](https://discuss.elastic.co/t/term-vectors-in-nested-documents/31556/3 "2017-07-05T23:45:53Z")

</div>


