# No results match your search criteria - Scripted Fields

**URL:** <https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987>\
**Category:** Kibana\
**Created:** [July 30, 2019, 8:41pm UTC](https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987 "2019-07-30T20:41:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedroamc](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@pedroamc](https://discuss.elastic.co/u/pedroamc)\
**Post date:** [July 30, 2019, 8:41pm UTC](https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987/1 "2019-07-30T20:41:43Z")

</div>

Hi!

I'm trying to use a scripted field to build some visualization at Kibana, but something is going wrong.

When I am at Management -\> Index Pattern -\> Create Scripted Field and preview the results for my script, it returns the first ten results. But when I try to see at Dicovery, I've got: "No results match your search criteria".

I've scripetd two fields but only the second one is causing trouble.

Could you help me?

test\_conv:

if(doc['deb\_cred.keyword'].value != 'S' &&  
doc['tipo\_evento.keyword'].value == '1'  
) {  
return doc['item.qtde\_doc\_item'].value\*-1;  
}  
return doc['item.qtde\_doc\_item'].value;

conv\_qtde\_item:

if(doc['event.keyword'].value == 'history\_purchase\_document'  
) {  
return doc['test\_conv'].value\*((doc['preco\_doc'].value/doc['preco\_unid'].value)\*(doc['conv\_denon'].value/doc['conv\_numer'].value))  
}  
else {  
return "";  
}

---

<div class="post-metadata">

**Author:** ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)\
**Post date:** [July 30, 2019, 8:49pm UTC](https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987/2 "2019-07-30T20:49:38Z")

</div>

Can you share a screenshot of Discover? You may need to update the time range in Discover, by default it only searches the last 15 minutes.

---

<div class="post-metadata">

**Author:** ![pedroamc](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@pedroamc](https://discuss.elastic.co/u/pedroamc)\
**Post date:** [July 31, 2019, 11:34am UTC](https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987/3 "2019-07-31T11:34:14Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/f/e/fe24d1a039b276fdceb57c0fdad9ff32eb63b728.png)

This is the error, but it only happens when I filter for that type of document (history\_purchase\_document) and my data are from the past, so I do not think time range is the problem.

---

<div class="post-metadata">

**Author:** ![pedroamc](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@pedroamc](https://discuss.elastic.co/u/pedroamc)\
**Post date:** [July 31, 2019, 11:55am UTC](https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987/4 "2019-07-31T11:55:03Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/6/0/60dc9b72f794baaab6f4a2c3bf23e90f26067801.png)

Indeed, my query returns 90147 hits with this same filter.

---

<div class="post-metadata">

**Author:** ![pedroamc](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@pedroamc](https://discuss.elastic.co/u/pedroamc)\
**Post date:** [August 1, 2019, 1:36pm UTC](https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987/5 "2019-08-01T13:36:46Z")

</div>

Hello! Any help?

---

<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:** [August 29, 2019, 1:37pm UTC](https://discuss.elastic.co/t/no-results-match-your-search-criteria-scripted-fields/192987/6 "2019-08-29T13:37:45Z")

</div>

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