# Elasticsearch dedicated percolator doc values in percolator script

**URL:** https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692
**Category:** Elasticsearch
**Created:** [April 28, 2016, 2:39pm UTC](https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692 "2016-04-28T14:39:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sandris](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@sandris](https://discuss.elastic.co/u/sandris)
#### Post date: [April 28, 2016, 2:39pm UTC](https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692/1 "2016-04-28T14:39:31Z")

</div>

Trying to migrate Elasticsearch from 1.x to 2.x, almost everything is done but I came up to this issue.

As mentioned in the Elasticsearch docs - [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-percolate.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-percolate.html) at the moment it is not possible to percolate geo\_points in the same index where documents are.

So I have created new index with the same mappings as document index. Percolating on the geo\_points works fine. But I am having problems with some inline groovy scripts.

Caused by: ScriptException[failed to run inline script [1000 \<= (doc['price'].value / doc['areaM2'].value) && (doc['  
price'].value / doc['areaM2'].value) \<= 10000] using lang [groovy]]; nested: IllegalStateException[unexpected docval  
ues type NONE for field 'price' (expected one of [SORTED\_NUMERIC, NUMERIC]). Use UninvertingReader or index with doc  
values.];  
price type is specified as long in the mappings, so it should have a doc value.

I have googled everything and have no idea how to fix it.

Only thing which comes in my mind - maybe document which is recently added has not built doc values at that point yet?

One more thing to mention - when I execute the same query in the search request - it works normally.

---

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [May 4, 2016, 7:04pm UTC](https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692/2 "2016-05-04T19:04:42Z")

</div>

Maybe this is not related, but can you tell me how did you migrate `.percolator` documents from ES 1.x to 2.x.  
As 1.x has an default `_id` field in the mapping which doesn't allow to migrate to ES 2.x.  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![sandris](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@sandris](https://discuss.elastic.co/u/sandris)
#### Post date: [May 4, 2016, 7:30pm UTC](https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692/3 "2016-05-04T19:30:32Z")

</div>

Well, since I needed to do some other stuff with these docs - I had a script which loaded them from one index to another.

---

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [May 4, 2016, 7:37pm UTC](https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692/4 "2016-05-04T19:37:35Z")

</div>

Thanks @sandris for the reply. I don't want to highjack your thread, if you can provide any help for this problem: [Snapshot & Restore failing while restoring indices from ES 1.6.1 to ES 2.1.2](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indexes-from-es-1-6-1-to-es-2-1-2/49197/3)

It would be really helpful.  
Thanks

---

<div class="post-metadata">

### Author: ![sandris](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@sandris](https://discuss.elastic.co/u/sandris)
#### Post date: [May 4, 2016, 7:46pm UTC](https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692/5 "2016-05-04T19:46:19Z")

</div>

Hmm, dont remember if I had the same problem.

But it looks like you need to manually move the data while removing that field. Should not be so hard.

---

<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:53pm UTC](https://discuss.elastic.co/t/elasticsearch-dedicated-percolator-doc-values-in-percolator-script/48692/6 "2017-07-05T22:53:56Z")

</div>


