# Combining index\_prefixes and term\_vector

**URL:** https://discuss.elastic.co/t/combining-index-prefixes-and-term-vector/180217
**Category:** Elasticsearch
**Created:** [May 8, 2019, 4:00pm UTC](https://discuss.elastic.co/t/combining-index-prefixes-and-term-vector/180217 "2019-05-08T16:00:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cthibodeau](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cthibodeau](https://discuss.elastic.co/u/cthibodeau)
#### Post date: [May 8, 2019, 4:00pm UTC](https://discuss.elastic.co/t/combining-index-prefixes-and-term-vector/180217/1 "2019-05-08T16:00:56Z")

</div>

Hi

We are trying to speed up our searches and highlightings on ES 6.7.2.

We first activated the term\_vector feature with the "with\_positions\_offsets" value. And it worked fine.

Then we added the "index\_prefixes" feature and we got the

java.lang.IllegalArgumentException: cannot index term vector offsets when term vectors are not indexed (field="searchable.\_index\_prefix") error.

Can these two features be used together ? And if so, what is the proper way ?

Thank you

```
{
    "myField": {
    	"type": "text",
    	"store": true,
    	"fields": {
    	  "searchable": {
    		"type": "text",
    		"term_vector": "with_positions_offsets",
    		"analyzer": "myAnalyzer",
    		"index_prefixes": {
    		  "min_chars": 2,
    		  "max_chars": 8
    		}
    	  }
    	}
```

---

<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: [June 5, 2019, 4:01pm UTC](https://discuss.elastic.co/t/combining-index-prefixes-and-term-vector/180217/2 "2019-06-05T16:01:05Z")

</div>

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