# Adding term vectors causes span queries to not work?

**URL:** <https://discuss.elastic.co/t/adding-term-vectors-causes-span-queries-to-not-work/57136>\
**Category:** Elasticsearch\
**Created:** [August 3, 2016, 5:00pm UTC](https://discuss.elastic.co/t/adding-term-vectors-causes-span-queries-to-not-work/57136 "2016-08-03T17:00:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanBlum](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@DanBlum](https://discuss.elastic.co/u/DanBlum)\
**Post date:** [August 3, 2016, 5:00pm UTC](https://discuss.elastic.co/t/adding-term-vectors-causes-span-queries-to-not-work/57136/1 "2016-08-03T17:00:02Z")

</div>

I need to do span\_near queries on an analyzed field. This has been working fine, but since I need highlighting and the plain highlighter is not fast enough on this field, I wanted to try the fast vector highlighter. So I re-indexed the documents with no changes except adding term\_vector: with\_positions\_offsets to this field.

Now the queries don't work at all - no results ever get returned. The term vectors look OK, not that I see why they would affect the actual query.

I am using ES 2.3.4. (I saw that fvh didn't work for span queries in an earlier version - since there is no mention of this restriction in the 2.3 documentation I am hoping this is no longer the case. Even if it is, I should still get results with no highlighting.)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 5, 2016, 12:23am UTC](https://discuss.elastic.co/t/adding-term-vectors-causes-span-queries-to-not-work/57136/2 "2016-08-05T00:23:32Z")

</div>

Can you provide the mappings and queries you are using?

---

<div class="post-metadata">

**Author:** ![DanBlum](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@DanBlum](https://discuss.elastic.co/u/DanBlum)\
**Post date:** [August 5, 2016, 3:07pm UTC](https://discuss.elastic.co/t/adding-term-vectors-causes-span-queries-to-not-work/57136/3 "2016-08-05T15:07:38Z")

</div>

Not easily as there is a custom token filter involved (it isn't the problem as the queries work fine as long as there are no term vectors).

Incidentally, is there an issue with notifications here? I did not get any notification that you had replied.

---

<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, 10:29pm UTC](https://discuss.elastic.co/t/adding-term-vectors-causes-span-queries-to-not-work/57136/4 "2017-07-05T22:29:47Z")

</div>


