# Problem in using native script

**URL:** <https://discuss.elastic.co/t/problem-in-using-native-script/4806>\
**Category:** Elasticsearch\
**Created:** [July 7, 2011, 9:18am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806 "2011-07-07T09:18:23Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 7, 2011, 9:18am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/1 "2011-07-07T09:18:23Z")

</div>

Hi.  
I followed instructions on the page "git://gist.github.com/  
1043766.git".  
But I am getting following error.  
ClassCastException[in.vedantu.search.scripts.UserRelativeScript cannot  
be cast to org.elasticsearch.script.NativeScriptFactory

Does somebody know what the problem is?

Regards.

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [July 7, 2011, 9:20am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/2 "2011-07-07T09:20:16Z")

</div>

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<[nachiketbhagwat@gmail.com](mailto:nachiketbhagwat@gmail.com)

> wrote:

> Hi.  
> I followed instructions on the page "git://gist.github.com/  
> 1043766.git".  
> But I am getting following error.  
> ClassCastException[in.vedantu.search.scripts.UserRelativeScript cannot  
> be cast to org.elasticsearch.script.NativeScriptFactory
> 
> Does somebody know what the problem is?
> 
> Regards.

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 8, 2011, 3:40am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/3 "2011-07-08T03:40:24Z")

</div>

Yes.  
But I am not sure if my perception of binding classes into jar was  
correct.  
All I did was I took Script and ScriptFactory classes and put them in  
a new folder and ran following command.  
jar -cvf myjar.jar classfolder.  
Is this the correct way?

On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:

> does UserRelativeScript extend/implement NativeScriptFactory?
> 
> On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > wrote:  
> > Hi.  
> > I followed instructions on the page "git://gist.github.com/  
> > 1043766.git".  
> > But I am getting following error.  
> > ClassCastException[in.vedantu.search.scripts.UserRelativeScript cannot  
> > be cast to org.elasticsearch.script.NativeScriptFactory
> 
> > Does somebody know what the problem is?
> 
> > Regards.
> 
> ## --
> 
> Paul Loy  
> p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [July 8, 2011, 9:32am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/4 "2011-07-08T09:32:01Z")

</div>

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat  
[nachiketbhagwat@gmail.com](mailto:nachiketbhagwat@gmail.com)wrote:

> Yes.  
> But I am not sure if my perception of binding classes into jar was  
> correct.  
> All I did was I took Script and ScriptFactory classes and put them in  
> a new folder and ran following command.  
> jar -cvf myjar.jar classfolder.  
> Is this the correct way?
> 
> On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> 
> > does UserRelativeScript extend/implement NativeScriptFactory?
> > 
> > On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<  
> > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > 
> > > wrote:  
> > > Hi.  
> > > I followed instructions on the page "git://gist.github.com/  
> > > 1043766.git".  
> > > But I am getting following error.  
> > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript cannot  
> > > be cast to org.elasticsearch.script.NativeScriptFactory
> > 
> > > Does somebody know what the problem is?
> > 
> > > Regards.
> > 
> > ## --
> > 
> > Paul Loy  
> > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 8, 2011, 10:30am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/5 "2011-07-08T10:30:45Z")

</div>

adding: in/(in = 0) (out= 0)(stored 0%)  
adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
adding: in/vedantu/search/scripts/UserRelativeScript.class(in = 680)  
(out= 402)(deflated 40%)  
adding: in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
943) (out= 455)(deflated 51%)

On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:

> what was the output when you ran the jar command?
> 
> On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat  
> [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> 
> > Yes.  
> > But I am not sure if my perception of binding classes into jar was  
> > correct.  
> > All I did was I took Script and ScriptFactory classes and put them in  
> > a new folder and ran following command.  
> > jar -cvf myjar.jar classfolder.  
> > Is this the correct way?
> 
> > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > 
> > > does UserRelativeScript extend/implement NativeScriptFactory?
> 
> > > On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<  
> > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > wrote:  
> > > > Hi.  
> > > > I followed instructions on the page "git://gist.github.com/  
> > > > 1043766.git".  
> > > > But I am getting following error.  
> > > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript cannot  
> > > > be cast to org.elasticsearch.script.NativeScriptFactory
> 
> > > > Does somebody know what the problem is?
> 
> > > > Regards.
> 
> > > ## --
> > > 
> > > Paul Loy  
> > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> ## --
> 
> Paul Loy  
> p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [July 8, 2011, 10:43am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/6 "2011-07-08T10:43:42Z")

</div>

Hmm, that looks OK to me. Can you gist more of the logs around the exception  
please?

On Fri, Jul 8, 2011 at 11:30 AM, nachiket bhagwat \<[nachiketbhagwat@gmail.com](mailto:nachiketbhagwat@gmail.com)

> wrote:

> adding: in/(in = 0) (out= 0)(stored 0%)  
> adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> adding: in/vedantu/search/scripts/UserRelativeScript.class(in = 680)  
> (out= 402)(deflated 40%)  
> adding: in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> 943) (out= 455)(deflated 51%)
> 
> On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> 
> > what was the output when you ran the jar command?
> > 
> > On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat  
> > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> > 
> > > Yes.  
> > > But I am not sure if my perception of binding classes into jar was  
> > > correct.  
> > > All I did was I took Script and ScriptFactory classes and put them in  
> > > a new folder and ran following command.  
> > > jar -cvf myjar.jar classfolder.  
> > > Is this the correct way?
> > 
> > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > 
> > > > does UserRelativeScript extend/implement NativeScriptFactory?
> > 
> > > > On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<  
> > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > 
> > > > > wrote:  
> > > > > Hi.  
> > > > > I followed instructions on the page "git://gist.github.com/  
> > > > > 1043766.git".  
> > > > > But I am getting following error.  
> > > > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript  
> > > > > cannot  
> > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> > 
> > > > > Does somebody know what the problem is?
> > 
> > > > > Regards.
> > 
> > > > ## --
> > > > 
> > > > Paul Loy  
> > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > 
> > ## --
> > 
> > Paul Loy  
> > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 8, 2011, 10:57am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/7 "2011-07-08T10:57:49Z")

</div>

Thanks paul.  
Logs are at git://gist.github.com/1071587.git.

On Jul 8, 3:43 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:

> Hmm, that looks OK to me. Can you gist more of the logs around the exception  
> please?
> 
> On Fri, Jul 8, 2011 at 11:30 AM, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > wrote:  
> > adding: in/(in = 0) (out= 0)(stored 0%)  
> > adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> > adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> > adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> > adding: in/vedantu/search/scripts/UserRelativeScript.class(in = 680)  
> > (out= 402)(deflated 40%)  
> > adding: in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> > 943) (out= 455)(deflated 51%)
> 
> > On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > 
> > > what was the output when you ran the jar command?
> 
> > > On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat  
> > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> 
> > > > Yes.  
> > > > But I am not sure if my perception of binding classes into jar was  
> > > > correct.  
> > > > All I did was I took Script and ScriptFactory classes and put them in  
> > > > a new folder and ran following command.  
> > > > jar -cvf myjar.jar classfolder.  
> > > > Is this the correct way?
> 
> > > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > 
> > > > > does UserRelativeScript extend/implement NativeScriptFactory?
> 
> > > > > On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<  
> > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > > > wrote:  
> > > > > > Hi.  
> > > > > > I followed instructions on the page "git://gist.github.com/  
> > > > > > 1043766.git".  
> > > > > > But I am getting following error.  
> > > > > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript  
> > > > > > cannot  
> > > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> 
> > > > > > Does somebody know what the problem is?
> 
> > > > > > Regards.
> 
> > > > > ## --
> > > > > 
> > > > > Paul Loy  
> > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > ## --
> > > 
> > > Paul Loy  
> > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> ## --
> 
> Paul Loy  
> p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [July 8, 2011, 2:00pm UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/8 "2011-07-08T14:00:23Z")

</div>

hmm, and what is your config?

On Fri, Jul 8, 2011 at 11:57 AM, nachiket bhagwat \<[nachiketbhagwat@gmail.com](mailto:nachiketbhagwat@gmail.com)

> wrote:

> Thanks paul.  
> Logs are at git://gist.github.com/1071587.git.
> 
> On Jul 8, 3:43 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> 
> > Hmm, that looks OK to me. Can you gist more of the logs around the  
> > exception  
> > please?
> > 
> > On Fri, Jul 8, 2011 at 11:30 AM, nachiket bhagwat \<  
> > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > 
> > > wrote:  
> > > adding: in/(in = 0) (out= 0)(stored 0%)  
> > > adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> > > adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> > > adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> > > adding: in/vedantu/search/scripts/UserRelativeScript.class(in = 680)  
> > > (out= 402)(deflated 40%)  
> > > adding: in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> > > 943) (out= 455)(deflated 51%)
> > 
> > > On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > 
> > > > what was the output when you ran the jar command?
> > 
> > > > On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat  
> > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> > 
> > > > > Yes.  
> > > > > But I am not sure if my perception of binding classes into jar was  
> > > > > correct.  
> > > > > All I did was I took Script and ScriptFactory classes and put them  
> > > > > in  
> > > > > a new folder and ran following command.  
> > > > > jar -cvf myjar.jar classfolder.  
> > > > > Is this the correct way?
> > 
> > > > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > 
> > > > > > does UserRelativeScript extend/implement NativeScriptFactory?
> > 
> > > > > > On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<  
> > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > 
> > > > > > > wrote:  
> > > > > > > Hi.  
> > > > > > > I followed instructions on the page "git://gist.github.com/  
> > > > > > > 1043766.git".  
> > > > > > > But I am getting following error.  
> > > > > > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript  
> > > > > > > cannot  
> > > > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> > 
> > > > > > > Does somebody know what the problem is?
> > 
> > > > > > > Regards.
> > 
> > > > > > ## --
> > > > > > 
> > > > > > Paul Loy  
> > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > 
> > > > ## --
> > > > 
> > > > Paul Loy  
> > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > 
> > ## --
> > 
> > Paul Loy  
> > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [July 8, 2011, 2:09pm UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/9 "2011-07-08T14:09:49Z")

</div>

Caused by: java.lang.ClassCastException:  
in.vedantu.search.scripts.UserRelativeScript cannot be cast to  
org.elasticsearch.script.NativeScript_Factory_

Is this because you need to be specifying the Factory not the Script in your  
conf?

On Fri, Jul 8, 2011 at 3:00 PM, Paul Loy [keteracel@gmail.com](mailto:keteracel@gmail.com) wrote:

> hmm, and what is your config?
> 
> On Fri, Jul 8, 2011 at 11:57 AM, nachiket bhagwat \<  
> [nachiketbhagwat@gmail.com](mailto:nachiketbhagwat@gmail.com)\> wrote:
> 
> > Thanks paul.  
> > Logs are at git://gist.github.com/1071587.git.
> > 
> > On Jul 8, 3:43 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > 
> > > Hmm, that looks OK to me. Can you gist more of the logs around the  
> > > exception  
> > > please?
> > > 
> > > On Fri, Jul 8, 2011 at 11:30 AM, nachiket bhagwat \<  
> > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > > 
> > > > wrote:  
> > > > adding: in/(in = 0) (out= 0)(stored 0%)  
> > > > adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> > > > adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> > > > adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> > > > adding: in/vedantu/search/scripts/UserRelativeScript.class(in = 680)  
> > > > (out= 402)(deflated 40%)  
> > > > adding: in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> > > > 943) (out= 455)(deflated 51%)
> > > 
> > > > On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > 
> > > > > what was the output when you ran the jar command?
> > > 
> > > > > On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat  
> > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> > > 
> > > > > > Yes.  
> > > > > > But I am not sure if my perception of binding classes into jar was  
> > > > > > correct.  
> > > > > > All I did was I took Script and ScriptFactory classes and put them  
> > > > > > in  
> > > > > > a new folder and ran following command.  
> > > > > > jar -cvf myjar.jar classfolder.  
> > > > > > Is this the correct way?
> > > 
> > > > > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > 
> > > > > > > does UserRelativeScript extend/implement NativeScriptFactory?
> > > 
> > > > > > > On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<  
> > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > > 
> > > > > > > > wrote:  
> > > > > > > > Hi.  
> > > > > > > > I followed instructions on the page "git://gist.github.com/  
> > > > > > > > 1043766.git".  
> > > > > > > > But I am getting following error.
> > 
> > ClassCastException[in.vedantu.search.scripts.UserRelativeScript
> > 
> > > > cannot
> > > > 
> > > > > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> > > 
> > > > > > > > Does somebody know what the problem is?
> > > 
> > > > > > > > Regards.
> > > 
> > > > > > > ## --
> > > > > > > 
> > > > > > > Paul Loy  
> > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > > 
> > > > > ## --
> > > > > 
> > > > > Paul Loy  
> > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > > 
> > > ## --
> > > 
> > > Paul Loy  
> > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> ## --
> 
> Paul Loy  
> [paul@keteracel.com](mailto:paul@keteracel.com)  
> [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 9, 2011, 3:13am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/10 "2011-07-09T03:13:02Z")

</div>

Yes.  
I guess that was the problem.  
Now the script is working fine.  
Thanks Paul.

On Jul 8, 7:09 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:

> Caused by: java.lang.ClassCastException:  
> in.vedantu.search.scripts.UserRelativeScript cannot be cast to  
> org.elasticsearch.script.NativeScript_Factory_
> 
> Is this because you need to be specifying the Factory not the Script in your  
> conf?
> 
> On Fri, Jul 8, 2011 at 3:00 PM, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> 
> > hmm, and what is your config?
> 
> > On Fri, Jul 8, 2011 at 11:57 AM, nachiket bhagwat \<  
> > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)\> wrote:
> 
> > > Thanks paul.  
> > > Logs are at git://gist.github.com/1071587.git.
> 
> > > On Jul 8, 3:43 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > 
> > > > Hmm, that looks OK to me. Can you gist more of the logs around the  
> > > > exception  
> > > > please?
> 
> > > > On Fri, Jul 8, 2011 at 11:30 AM, nachiket bhagwat \<  
> > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > > wrote:  
> > > > > adding: in/(in = 0) (out= 0)(stored 0%)  
> > > > > adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> > > > > adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> > > > > adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> > > > > adding: in/vedantu/search/scripts/UserRelativeScript.class(in = 680)  
> > > > > (out= 402)(deflated 40%)  
> > > > > adding: in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> > > > > 943) (out= 455)(deflated 51%)
> 
> > > > > On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > 
> > > > > > what was the output when you ran the jar command?
> 
> > > > > > On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat  
> > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> 
> > > > > > > Yes.  
> > > > > > > But I am not sure if my perception of binding classes into jar was  
> > > > > > > correct.  
> > > > > > > All I did was I took Script and ScriptFactory classes and put them  
> > > > > > > in  
> > > > > > > a new folder and ran following command.  
> > > > > > > jar -cvf myjar.jar classfolder.  
> > > > > > > Is this the correct way?
> 
> > > > > > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > > 
> > > > > > > > does UserRelativeScript extend/implement NativeScriptFactory?
> 
> > > > > > > > On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat \<  
> > > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > > > > > > wrote:  
> > > > > > > > > Hi.  
> > > > > > > > > I followed instructions on the page "git://gist.github.com/  
> > > > > > > > > 1043766.git".  
> > > > > > > > > But I am getting following error.
> 
> > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript
> > > 
> > > > > cannot
> > > > > 
> > > > > > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> 
> > > > > > > > > Does somebody know what the problem is?
> 
> > > > > > > > > Regards.
> 
> > > > > > > > ## --
> > > > > > > > 
> > > > > > > > Paul Loy  
> > > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > > > > ## --
> > > > > > 
> > > > > > Paul Loy  
> > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > > ## --
> > > > 
> > > > Paul Loy  
> > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > ## --
> > 
> > Paul Loy  
> > [p...@keteracel.com](mailto:p...@keteracel.com)  
> > [http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)
> 
> ## --
> 
> Paul Loy  
> p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 9, 2011, 5:19am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/11 "2011-07-09T05:19:00Z")

</div>

Hi. There is another problem. Though it has nothing to do with above  
one.

I want to add parameters to my script.  
I referenced this document  
Passing parameters to native script : '[http://groups.google.com/a/](http://groups.google.com/a/)  
[elasticsearch.com/group/users/browse\_thread/thread/59b85fab8e35f1e3](http://elasticsearch.com/group/users/browse_thread/thread/59b85fab8e35f1e3)'

Now my ScriptFactory class became a factory that simply creates an  
AbstractFloatScript:  
The file is at git://gist.github.com/1073346.git.

Now I am getting following error.  
git://gist.github.com/1073348.git

Isn't this the right way to pass parameters?

Regards.

On Jul 9, 8:13 am, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) wrote:

> Yes.  
> I guess that was the problem.  
> Now the script is working fine.  
> Thanks Paul.
> 
> On Jul 8, 7:09 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> 
> > Caused by: java.lang.ClassCastException:  
> > in.vedantu.search.scripts.UserRelativeScript cannot be cast to  
> > org.elasticsearch.script.NativeScript_Factory_
> 
> > Is this because you need to be specifying the Factory not the Script in your  
> > conf?
> 
> > On Fri, Jul 8, 2011 at 3:00 PM, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > 
> > > hmm, and what is your config?
> 
> > > On Fri, Jul 8, 2011 at 11:57 AM,nachiketbhagwat \<  
> > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)\> wrote:
> 
> > > > Thanks paul.  
> > > > Logs are at git://gist.github.com/1071587.git.
> 
> > > > On Jul 8, 3:43 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > 
> > > > > Hmm, that looks OK to me. Can you gist more of the logs around the  
> > > > > exception  
> > > > > please?
> 
> > > > > On Fri, Jul 8, 2011 at 11:30 AM,nachiketbhagwat \<  
> > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > > > wrote:  
> > > > > > adding: in/(in = 0) (out= 0)(stored 0%)  
> > > > > > adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> > > > > > adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> > > > > > adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> > > > > > adding: in/vedantu/search/scripts/UserRelativeScript.class(in = 680)  
> > > > > > (out= 402)(deflated 40%)  
> > > > > > adding: in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> > > > > > 943) (out= 455)(deflated 51%)
> 
> > > > > > On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > 
> > > > > > > what was the output when you ran the jar command?
> 
> > > > > > > On Fri, Jul 8, 2011 at 4:40 AM,nachiketbhagwat  
> > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> 
> > > > > > > > Yes.  
> > > > > > > > But I am not sure if my perception of binding classes into jar was  
> > > > > > > > correct.  
> > > > > > > > All I did was I took Script and ScriptFactory classes and put them  
> > > > > > > > in  
> > > > > > > > a new folder and ran following command.  
> > > > > > > > jar -cvf myjar.jar classfolder.  
> > > > > > > > Is this the correct way?
> 
> > > > > > > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > > > 
> > > > > > > > > does UserRelativeScript extend/implement NativeScriptFactory?
> 
> > > > > > > > > On Thu, Jul 7, 2011 at 10:18 AM,nachiketbhagwat \<  
> > > > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > > > > > > > wrote:  
> > > > > > > > > > Hi.  
> > > > > > > > > > I followed instructions on the page "git://gist.github.com/  
> > > > > > > > > > 1043766.git".  
> > > > > > > > > > But I am getting following error.
> 
> > > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript
> > > > 
> > > > > > cannot
> > > > > > 
> > > > > > > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> 
> > > > > > > > > > Does somebody know what the problem is?
> 
> > > > > > > > > > Regards.
> 
> > > > > > > > > ## --
> > > > > > > > > 
> > > > > > > > > Paul Loy  
> > > > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > > > > > ## --
> > > > > > > 
> > > > > > > Paul Loy  
> > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > > > ## --
> > > > > 
> > > > > Paul Loy  
> > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > ## --
> > > 
> > > Paul Loy  
> > > [p...@keteracel.com](mailto:p...@keteracel.com)  
> > > [http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)
> 
> > ## --
> > 
> > Paul Loy  
> > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [July 9, 2011, 11:21pm UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/12 "2011-07-09T23:21:59Z")

</div>

Well it looks like it can't find the nested ($1) class. Did you remake your  
jar correctly?

On Sat, Jul 9, 2011 at 6:19 AM, nachiket bhagwat  
[nachiketbhagwat@gmail.com](mailto:nachiketbhagwat@gmail.com)wrote:

> Hi. There is another problem. Though it has nothing to do with above  
> one.
> 
> I want to add parameters to my script.  
> I referenced this document  
> Passing parameters to native script : '[http://groups.google.com/a/](http://groups.google.com/a/)  
> [elasticsearch.com/group/users/browse\_thread/thread/59b85fab8e35f1e3](http://elasticsearch.com/group/users/browse_thread/thread/59b85fab8e35f1e3)'
> 
> Now my ScriptFactory class became a factory that simply creates an  
> AbstractFloatScript:  
> The file is at git://gist.github.com/1073346.git.
> 
> Now I am getting following error.  
> git://gist.github.com/1073348.git
> 
> Isn't this the right way to pass parameters?
> 
> Regards.
> 
> On Jul 9, 8:13 am, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) wrote:
> 
> > Yes.  
> > I guess that was the problem.  
> > Now the script is working fine.  
> > Thanks Paul.
> > 
> > On Jul 8, 7:09 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > 
> > > Caused by: java.lang.ClassCastException:  
> > > in.vedantu.search.scripts.UserRelativeScript cannot be cast to  
> > > org.elasticsearch.script.NativeScript_Factory_
> > 
> > > Is this because you need to be specifying the Factory not the Script in  
> > > your  
> > > conf?
> > 
> > > On Fri, Jul 8, 2011 at 3:00 PM, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > 
> > > > hmm, and what is your config?
> > 
> > > > On Fri, Jul 8, 2011 at 11:57 AM,nachiketbhagwat \<  
> > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)\> wrote:
> > 
> > > > > Thanks paul.  
> > > > > Logs are at git://gist.github.com/1071587.git.
> > 
> > > > > On Jul 8, 3:43 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > 
> > > > > > Hmm, that looks OK to me. Can you gist more of the logs around the  
> > > > > > exception  
> > > > > > please?
> > 
> > > > > > On Fri, Jul 8, 2011 at 11:30 AM,nachiketbhagwat \<  
> > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > 
> > > > > > > wrote:  
> > > > > > > adding: in/(in = 0) (out= 0)(stored 0%)  
> > > > > > > adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> > > > > > > adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> > > > > > > adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> > > > > > > adding: in/vedantu/search/scripts/UserRelativeScript.class(in =
> 
> 1. 
> 
> > > > > > > (out= 402)(deflated 40%)  
> > > > > > > adding:  
> > > > > > > in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> > > > > > > 943) (out= 455)(deflated 51%)
> > 
> > > > > > > On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > > 
> > > > > > > > what was the output when you ran the jar command?
> > 
> > > > > > > > On Fri, Jul 8, 2011 at 4:40 AM,nachiketbhagwat  
> > > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> > 
> > > > > > > > > Yes.  
> > > > > > > > > But I am not sure if my perception of binding classes into  
> > > > > > > > > jar was  
> > > > > > > > > correct.  
> > > > > > > > > All I did was I took Script and ScriptFactory classes and  
> > > > > > > > > put them  
> > > > > > > > > in  
> > > > > > > > > a new folder and ran following command.  
> > > > > > > > > jar -cvf myjar.jar classfolder.  
> > > > > > > > > Is this the correct way?
> > 
> > > > > > > > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > > > > 
> > > > > > > > > > does UserRelativeScript extend/implement  
> > > > > > > > > > NativeScriptFactory?
> > 
> > > > > > > > > > On Thu, Jul 7, 2011 at 10:18 AM,nachiketbhagwat \<  
> > > > > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> > 
> > > > > > > > > > > wrote:  
> > > > > > > > > > > Hi.  
> > > > > > > > > > > I followed instructions on the page "git://  
> > > > > > > > > > > [gist.github.com/](http://gist.github.com/)  
> > > > > > > > > > > 1043766.git".  
> > > > > > > > > > > But I am getting following error.
> > 
> > > > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript
> > > > > 
> > > > > > > cannot
> > > > > > > 
> > > > > > > > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> > 
> > > > > > > > > > > Does somebody know what the problem is?
> > 
> > > > > > > > > > > Regards.
> > 
> > > > > > > > > > ## --
> > > > > > > > > > 
> > > > > > > > > > Paul Loy  
> > > > > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > 
> > > > > > > > ## --
> > > > > > > > 
> > > > > > > > Paul Loy  
> > > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > 
> > > > > > ## --
> > > > > > 
> > > > > > Paul Loy  
> > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> > 
> > > > ## --
> > > > 
> > > > Paul Loy  
> > > > [p...@keteracel.com](mailto:p...@keteracel.com)  
> > > > [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)
> > 
> > > ## --
> > > 
> > > Paul Loy  
> > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 15, 2011, 5:50am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/13 "2011-07-15T05:50:52Z")

</div>

Yes. In the same way.  
I just wrote the factory class and did NOT write the script class.  
Instead I wrote my runAsFloat function in factory class itself.

public ExecutableScript newScript(final Map\<String, Object\> params) {  
return new AbstractFloatSearchScript() {

```
        @Override
        public float runAsFloat() {
           ///My function
        }
   };

```

}

The problem is still persisting. The same problem as I mentioned  
above.  
git://gist.github.com/1073348.git.

My jar file is constructed correctly. I am sure about that. Can there  
be any other reason for this?

Regards.

On Jul 10, 4:21 am, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:

> Well it looks like it can't find the nested ($1) class. Did you remake your  
> jar correctly?
> 
> On Sat, Jul 9, 2011 at 6:19 AM, nachiket bhagwat  
> [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> 
> > Hi. There is another problem. Though it has nothing to do with above  
> > one.
> 
> > I want to add parameters to my script.  
> > I referenced this document  
> > Passing parameters to native script : '[http://groups.google.com/a/](http://groups.google.com/a/)  
> > [elasticsearch.com/group/users/browse\_thread/thread/59b85fab8e35f1e3](http://elasticsearch.com/group/users/browse_thread/thread/59b85fab8e35f1e3)'
> 
> > Now my ScriptFactory class became a factory that simply creates an  
> > AbstractFloatScript:  
> > The file is at git://gist.github.com/1073346.git.
> 
> > Now I am getting following error.  
> > git://gist.github.com/1073348.git
> 
> > Isn't this the right way to pass parameters?
> 
> > Regards.
> 
> > On Jul 9, 8:13 am, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) wrote:
> > 
> > > Yes.  
> > > I guess that was the problem.  
> > > Now the script is working fine.  
> > > Thanks Paul.
> 
> > > On Jul 8, 7:09 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> 
> > > > Caused by: java.lang.ClassCastException:  
> > > > in.vedantu.search.scripts.UserRelativeScript cannot be cast to  
> > > > org.elasticsearch.script.NativeScript_Factory_
> 
> > > > Is this because you need to be specifying the Factory not the Script in  
> > > > your  
> > > > conf?
> 
> > > > On Fri, Jul 8, 2011 at 3:00 PM, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > 
> > > > > hmm, and what is your config?
> 
> > > > > On Fri, Jul 8, 2011 at 11:57 AM,nachiketbhagwat \<  
> > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)\> wrote:
> 
> > > > > > Thanks paul.  
> > > > > > Logs are at git://gist.github.com/1071587.git.
> 
> > > > > > On Jul 8, 3:43 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > 
> > > > > > > Hmm, that looks OK to me. Can you gist more of the logs around the  
> > > > > > > exception  
> > > > > > > please?
> 
> > > > > > > On Fri, Jul 8, 2011 at 11:30 AM,nachiketbhagwat \<  
> > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > > > > > wrote:  
> > > > > > > > adding: in/(in = 0) (out= 0)(stored 0%)  
> > > > > > > > adding: in/vedantu/(in = 0) (out= 0)(stored 0%)  
> > > > > > > > adding: in/vedantu/search/(in = 0) (out= 0)(stored 0%)  
> > > > > > > > adding: in/vedantu/search/scripts/(in = 0) (out= 0)(stored 0%)  
> > > > > > > > adding: in/vedantu/search/scripts/UserRelativeScript.class(in =
> > 
> > 1. 
> > 
> > > > > > > > (out= 402)(deflated 40%)  
> > > > > > > > adding:  
> > > > > > > > in/vedantu/search/scripts/UserRelativeScriptFactory.class(in =  
> > > > > > > > 943) (out= 455)(deflated 51%)
> 
> > > > > > > > On Jul 8, 2:32 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > > > 
> > > > > > > > > what was the output when you ran the jar command?
> 
> > > > > > > > > On Fri, Jul 8, 2011 at 4:40 AM,nachiketbhagwat  
> > > > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)wrote:
> 
> > > > > > > > > > Yes.  
> > > > > > > > > > But I am not sure if my perception of binding classes into  
> > > > > > > > > > jar was  
> > > > > > > > > > correct.  
> > > > > > > > > > All I did was I took Script and ScriptFactory classes and  
> > > > > > > > > > put them  
> > > > > > > > > > in  
> > > > > > > > > > a new folder and ran following command.  
> > > > > > > > > > jar -cvf myjar.jar classfolder.  
> > > > > > > > > > Is this the correct way?
> 
> > > > > > > > > > On Jul 7, 2:20 pm, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> > > > > > > > > > 
> > > > > > > > > > > does UserRelativeScript extend/implement  
> > > > > > > > > > > NativeScriptFactory?
> 
> > > > > > > > > > > On Thu, Jul 7, 2011 at 10:18 AM,nachiketbhagwat \<  
> > > > > > > > > > > [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)
> 
> > > > > > > > > > > > wrote:  
> > > > > > > > > > > > Hi.  
> > > > > > > > > > > > I followed instructions on the page "git://  
> > > > > > > > > > > > [gist.github.com/](http://gist.github.com/)  
> > > > > > > > > > > > 1043766.git".  
> > > > > > > > > > > > But I am getting following error.
> 
> > > > > > ClassCastException[in.vedantu.search.scripts.UserRelativeScript
> > > > > > 
> > > > > > > > cannot
> > > > > > > > 
> > > > > > > > > > > > be cast to org.elasticsearch.script.NativeScriptFactory
> 
> > > > > > > > > > > > Does somebody know what the problem is?
> 
> > > > > > > > > > > > Regards.
> 
> > > > > > > > > > > ## --
> > > > > > > > > > > 
> > > > > > > > > > > Paul Loy  
> > > > > > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > > > > > > > ## --
> > > > > > > > > 
> > > > > > > > > Paul Loy  
> > > > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > > > > > ## --
> > > > > > > 
> > > > > > > Paul Loy  
> > > > > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> > > > > ## --
> > > > > 
> > > > > Paul Loy  
> > > > > [p...@keteracel.com](mailto:p...@keteracel.com)  
> > > > > [http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)
> 
> > > > ## --
> > > > 
> > > > Paul Loy  
> > > > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy
> 
> ## --
> 
> Paul Loy  
> p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<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, 4:00am UTC](https://discuss.elastic.co/t/problem-in-using-native-script/4806/14 "2017-07-06T04:00:32Z")

</div>


