# Position Data Error

**URL:** <https://discuss.elastic.co/t/position-data-error/63941>\
**Category:** Kibana\
**Created:** [October 25, 2016, 10:20pm UTC](https://discuss.elastic.co/t/position-data-error/63941 "2016-10-25T22:20:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fvegaucr](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fvegaucr](https://discuss.elastic.co/u/fvegaucr)\
**Post date:** [October 25, 2016, 10:20pm UTC](https://discuss.elastic.co/t/position-data-error/63941/1 "2016-10-25T22:20:17Z")

</div>

I m using the following version of ES:

```auto
"name" : "dwh-edge001",
  "cluster_name" : "prod_dwh_expansion",
  "version" : {
    "number" : "2.3.1",
    "build_hash" : "bd980929010aef404e7cb0843e61d0665269fc39",
    "build_timestamp" : "2016-04-04T12:25:05Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.0"
  },
  "tagline" : "You Know, for Search"
}

```

Currently we are using templates to index our data:

```auto
{
  "template" : "fernando_test",
  "settings" : {
    "index.refresh_interval" : "5s",
    "index.routing.allocation.require.node_type": "hot",
    "analysis" : {
      "analyzer" : {
        "default" : {
          "type" : "standard",
          "stopwords" : "_none_"
        }
      }
    }
  },
  "mappings" : {
    "_default_" : {
      "_all" : {"enabled" : true},
      "dynamic_templates" : [ {
        "string_fields" : {
          "match" : "*",
          "match_mapping_type" : "string",
          "mapping" : {
            "type" : "multi_field",
            "fields" : {
              "{name}" : {"type": "string", "position_increment_gap": 0, "index" : "analyzed", "omit_norms" : true, "index_options" : "docs"}
            }
          }
        }
      } ],
      "properties" : {
        "@version": { "type": "string", "index": "not_analyzed" },
        "geoip" : {
          "type" : "object",
          "dynamic": true,
          "properties" : {
            "ip" : { "type": "ip" },
            "location" : { "type" : "geo_point" }
          }
        },
        "tags": { "type": "string", "index": "not_analyzed" },
        "pid": { "type": "long", "index": "not_analyzed" },
        "priority": { "type": "integer", "index": "not_analyzed" },
        "severity": { "type": "integer", "index": "not_analyzed" },
        "facility": { "type": "integer", "index": "not_analyzed" },
        "syslog_severity_code": { "type": "integer", "index": "not_analyzed" },
        "syslog_facility_code": { "type": "integer", "index": "not_analyzed" }
      }
    }
  }
}

```

So whenever I tried to visualize a hostname proxy001.sing1 for one of our indexes I get the following error in kibana:

```auto
Error: Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"illegal_state_exception","reason":"field \"beat.name\" was indexed without position data; cannot run PhraseQuery (phrase=beat.name:\"proxy001 sing1\")"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"fernando_test","node":"jPoFBJ9TT0eSSXEWIao0mQ","reason":{"type":"illegal_state_exception","reason":"field \"beat.name\" was indexed without position data; cannot run PhraseQuery (phrase=beat.name:\"proxy001 sing1\")"}}]}}

```

Any idea what Im doing wrong here.

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [October 25, 2016, 10:46pm UTC](https://discuss.elastic.co/t/position-data-error/63941/2 "2016-10-25T22:46:07Z")

</div>

> [@fvegaucr](#):
>
> "index\_options" : "docs"

> **[index\_options | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-options.html#index-options)**

Setting `index_options` to `"docs"` means that it does not support phrase queries. Perhaps there is some combination of [query string options](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) you could speficy in the [`query:queryString:options` advanced setting](https://www.elastic.co/guide/en/kibana/current/advanced-options.html)

---

<div class="post-metadata">

**Author:** ![fvegaucr](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fvegaucr](https://discuss.elastic.co/u/fvegaucr)\
**Post date:** [October 27, 2016, 10:29pm UTC](https://discuss.elastic.co/t/position-data-error/63941/3 "2016-10-27T22:29:58Z")

</div>

Ok , I think Im close to get what I need. So when I set change the config of index as not\_analyzed in the fields portion now I can query the exact match. I want that whenever one of the fields is name hostname.

"fields" : {  
"{name}" : {"type": "string", "position\_increment\_gap": 0, "index" : "not\_analyzed", "omit\_norms" : true, "index\_options" : "docs"}

However whenever the field is called message I want to be analyzed is there a way to accomplish that.  
Can I set it in the properties by:

"properties" : {  
"@version": { "type": "string", "index": "not\_analyzed" },  
"message": { "type": "string", "index":"analyzed"},

---

<div class="post-metadata">

**Author:** ![fvegaucr](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fvegaucr](https://discuss.elastic.co/u/fvegaucr)\
**Post date:** [October 31, 2016, 7:14pm UTC](https://discuss.elastic.co/t/position-data-error/63941/4 "2016-10-31T19:14:10Z")

</div>

Ok I this can be closed.  
I manage to perfrom what I was looking for

"dynamic\_templates" : [  
{  
"beat" : {  
"path\_match" : "beat._",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "string",  
"index" : "not\_analyzed",  
"omit\_norms" : true,  
"index\_options" : "offsets"  
}  
}  
},  
{  
"string\_fields" : {  
"match" : "_",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "multi\_field",  
"fields" : {  
"{name}" : {"type": "string", "index" : "analyzed", "omit\_norms" : true, "index\_options" : "offsets"}  
}  
}  
}  
} ],

---

<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, 1:34pm UTC](https://discuss.elastic.co/t/position-data-error/63941/5 "2017-07-06T13:34:59Z")

</div>


