# Field “title” was indexed without position data; cannot run PhraseQuery

**URL:** <https://discuss.elastic.co/t/field-title-was-indexed-without-position-data-cannot-run-phrasequery/13946>\
**Category:** Elasticsearch\
**Created:** [October 14, 2013, 9:03pm UTC](https://discuss.elastic.co/t/field-title-was-indexed-without-position-data-cannot-run-phrasequery/13946 "2013-10-14T21:03:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene1](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@Eugene1](https://discuss.elastic.co/u/Eugene1)\
**Post date:** [October 14, 2013, 9:03pm UTC](https://discuss.elastic.co/t/field-title-was-indexed-without-position-data-cannot-run-phrasequery/13946/1 "2013-10-14T21:03:30Z")

</div>

I have an index in ElasticSearch with the following mapping:

mappings: {  
feed: {  
properties: {  
html\_url: {  
index: not\_analyzed  
omit\_norms: true  
index\_options: docs  
type: string  
}  
title: {  
index\_options: offsets  
type: string  
}  
created: {  
store: true  
format: yyyy-MM-dd HH:mm:ss  
type: date  
}  
description: {  
type: string  
}  
}  
}  
getting the following error when performing phrase search ("video games"):

IllegalStateException[field "title" was indexed without position data; cannot run PhraseQuery (term=video)];

Single word searches work fine. Tried "index\_options: positions" as well but with no luck. Title field contains text in multiple languages, sometimes empty. Interesting that it seems to fail randomly, for example it would fail with 200K documents or 800K using the same dataset. Is there a reason some titles wouldn't get indexed with positions?

Elastic search version 0.90.5

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [October 14, 2013, 9:13pm UTC](https://discuss.elastic.co/t/field-title-was-indexed-without-position-data-cannot-run-phrasequery/13946/2 "2013-10-14T21:13:06Z")

</div>

for phrase queries you need "index\_options : positions" but you can't  
change it after the fact. You need to reindex and likely create a new  
mapping / index

simon

On Monday, October 14, 2013 11:03:30 PM UTC+2, eugene.kim wrote:

> I have an index in Elasticsearch with the following mapping:
> 
> mappings: {  
> feed: {  
> properties: {  
> html\_url: {  
> index: not\_analyzed  
> omit\_norms: true  
> index\_options: docs  
> type: string  
> }  
> title: {  
> index\_options: offsets  
> type: string  
> }  
> created: {  
> store: true  
> format: yyyy-MM-dd HH:mm:ss  
> type: date  
> }  
> description: {  
> type: string  
> }  
> }  
> }  
> getting the following error when performing phrase search ("video games"):
> 
> IllegalStateException[field "title" was indexed without position data;  
> cannot run PhraseQuery (term=video)];
> 
> Single word searches work fine. Tried "index\_options: positions" as well  
> but  
> with no luck. Title field contains text in multiple languages, sometimes  
> empty. Interesting that it seems to fail randomly, for example it would  
> fail  
> with 200K documents or 800K using the same dataset. Is there a reason some  
> titles wouldn't get indexed with positions?
> 
> Elastic search version 0.90.5
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/field-title-was-indexed-without-position-data-cannot-run-PhraseQuery-tp4042524.html](http://elasticsearch-users.115913.n3.nabble.com/field-title-was-indexed-without-position-data-cannot-run-PhraseQuery-tp4042524.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Eugene1](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@Eugene1](https://discuss.elastic.co/u/Eugene1)\
**Post date:** [October 14, 2013, 9:16pm UTC](https://discuss.elastic.co/t/field-title-was-indexed-without-position-data-cannot-run-phrasequery/13946/3 "2013-10-14T21:16:52Z")

</div>

Thank you for your answer. With each test i delete index and re-create it with the above mappings and then re-index the whole dataset but it still randomly fails. Nothing in the logs too...

---

<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 6, 2017, 2:12am UTC](https://discuss.elastic.co/t/field-title-was-indexed-without-position-data-cannot-run-phrasequery/13946/4 "2017-07-06T02:12:30Z")

</div>


