# Trouble with native script and script filter

**URL:** https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876
**Category:** Elasticsearch
**Created:** [August 29, 2012, 12:51am UTC](https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876 "2012-08-29T00:51:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mic\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mic_2/32/2753_2.png) [@mic\_2](https://discuss.elastic.co/u/mic_2)
#### Post date: [August 29, 2012, 12:51am UTC](https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876/1 "2012-08-29T00:51:59Z")

</div>

Hi,

I have been trying to create a native script that will work with the script  
filter.

So far I have compiled and completed the tutorial here for how to make  
customscore native scripts.  
[http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/](http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/)

My question is how to make a native script work with the script filter.

Here is a gist of what I have tried so far and the error I receive.

Any pointers would be greatly appreciated.

Thank you

Sincerely,  
Mic Johnson

--

---

<div class="post-metadata">

### Author: ![mic\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mic_2/32/2753_2.png) [@mic\_2](https://discuss.elastic.co/u/mic_2)
#### Post date: [August 29, 2012, 12:53am UTC](https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876/2 "2012-08-29T00:53:45Z")

</div>

Oops, forgot the gist: [https://gist.github.com/6f2c97754bdd7914f78d](https://gist.github.com/6f2c97754bdd7914f78d)

On Tue, Aug 28, 2012 at 5:51 PM, Mic [micjohnson@gmail.com](mailto:micjohnson@gmail.com) wrote:

> Hi,
> 
> I have been trying to create a native script that will work with the  
> script filter.
> 
> So far I have compiled and completed the tutorial here for how to make  
> customscore native scripts.
> 
> [Elasticsearch native scripts for dummies - Space Vatican](http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/)
> 
> My question is how to make a native script work with the script filter.
> 
> Here is a gist of what I have tried so far and the error I receive.
> 
> Any pointers would be greatly appreciated.
> 
> Thank you
> 
> Sincerely,  
> Mic Johnson
> 
> --

--

---

<div class="post-metadata">

### Author: ![Cedric\_Hourcade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cedric_hourcade/32/1451_2.png) [@Cedric\_Hourcade](https://discuss.elastic.co/u/Cedric_Hourcade)
#### Post date: [August 29, 2012, 10:03am UTC](https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876/3 "2012-08-29T10:03:49Z")

</div>

Hello,

You just forgot to specify your script language with the "lang" parameter,  
see : [gist:3509591 · GitHub](https://gist.github.com/3509591)

Cédric

Le mercredi 29 août 2012 02:51:59 UTC+2, Mic a écrit :

> Hi,
> 
> I have been trying to create a native script that will work with the  
> script filter.
> 
> So far I have compiled and completed the tutorial here for how to make  
> customscore native scripts.
> 
> [Elasticsearch native scripts for dummies - Space Vatican](http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/)
> 
> My question is how to make a native script work with the script filter.
> 
> Here is a gist of what I have tried so far and the error I receive.
> 
> Any pointers would be greatly appreciated.
> 
> Thank you
> 
> Sincerely,  
> Mic Johnson

--

---

<div class="post-metadata">

### Author: ![mic\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mic_2/32/2753_2.png) [@mic\_2](https://discuss.elastic.co/u/mic_2)
#### Post date: [August 30, 2012, 2:04am UTC](https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876/4 "2012-08-30T02:04:42Z")

</div>

Hello,

Cédric, you have no clue how happy this makes me. Thank you.

Sincerely,  
Mic Johnson

On Wed, Aug 29, 2012 at 3:03 AM, Cédric Hourcade [ced@wal.fr](mailto:ced@wal.fr) wrote:

> Hello,
> 
> You just forgot to specify your script language with the "lang" parameter,  
> see : [gist:3509591 · GitHub](https://gist.github.com/3509591)
> 
> Cédric
> 
> Le mercredi 29 août 2012 02:51:59 UTC+2, Mic a écrit :
> 
> > Hi,
> > 
> > I have been trying to create a native script that will work with the  
> > script filter.
> > 
> > So far I have compiled and completed the tutorial here for how to make  
> > customscore native scripts.  
> > [http://www.spacevatican.org/\*\*2012/5/12/elasticsearch-](http://www.spacevatican.org/**2012/5/12/elasticsearch-)\*\*  
> > native-scripts-for-dummies/[http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/](http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/)
> > 
> > My question is how to make a native script work with the script filter.
> > 
> > Here is a gist of what I have tried so far and the error I receive.
> > 
> > Any pointers would be greatly appreciated.
> > 
> > Thank you
> > 
> > Sincerely,  
> > Mic Johnson
> 
> --

--

---

<div class="post-metadata">

### Author: ![mic\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mic_2/32/2753_2.png) [@mic\_2](https://discuss.elastic.co/u/mic_2)
#### Post date: [August 30, 2012, 2:49am UTC](https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876/5 "2012-08-30T02:49:52Z")

</div>

To complete this topic, I had to extend AbstractSearchScript instead of  
AbstractExecutableScript. But now I'm rockin'.

On Wed, Aug 29, 2012 at 7:04 PM, Mic Johnson [micjohnson@gmail.com](mailto:micjohnson@gmail.com) wrote:

> Hello,
> 
> Cédric, you have no clue how happy this makes me. Thank you.
> 
> Sincerely,  
> Mic Johnson
> 
> On Wed, Aug 29, 2012 at 3:03 AM, Cédric Hourcade [ced@wal.fr](mailto:ced@wal.fr) wrote:
> 
> > Hello,
> > 
> > You just forgot to specify your script language with the "lang"  
> > parameter, see : [gist:3509591 · GitHub](https://gist.github.com/3509591)
> > 
> > Cédric
> > 
> > Le mercredi 29 août 2012 02:51:59 UTC+2, Mic a écrit :
> > 
> > > Hi,
> > > 
> > > I have been trying to create a native script that will work with the  
> > > script filter.
> > > 
> > > So far I have compiled and completed the tutorial here for how to make  
> > > customscore native scripts.  
> > > [http://www.spacevatican.org/\*\*2012/5/12/elasticsearch-](http://www.spacevatican.org/**2012/5/12/elasticsearch-)\*\*  
> > > native-scripts-for-dummies/[http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/](http://www.spacevatican.org/2012/5/12/elasticsearch-native-scripts-for-dummies/)
> > > 
> > > My question is how to make a native script work with the script filter.
> > > 
> > > Here is a gist of what I have tried so far and the error I receive.
> > > 
> > > Any pointers would be greatly appreciated.
> > > 
> > > Thank you
> > > 
> > > Sincerely,  
> > > Mic Johnson
> > 
> > --

--

---

<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, 3:14am UTC](https://discuss.elastic.co/t/trouble-with-native-script-and-script-filter/8876/6 "2017-07-06T03:14:40Z")

</div>


