Problem in using native script

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.

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <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
http://uk.linkedin.com/in/paulloy

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <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

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat
nachiketbhagwat@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <
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
http://uk.linkedin.com/in/paulloy

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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <
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

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

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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <
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
http://uk.linkedin.com/in/paulloy

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

On Jul 8, 3:43 pm, Paul Loy 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

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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <
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

hmm, and what is your config?

On Fri, Jul 8, 2011 at 11:57 AM, nachiket bhagwat <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 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

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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <
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
http://uk.linkedin.com/in/paulloy

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

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 wrote:

hmm, and what is your config?

On Fri, Jul 8, 2011 at 11:57 AM, nachiket bhagwat <
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 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

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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <
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
http://uk.linkedin.com/in/paulloy

--

Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy

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 wrote:

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

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 wrote:

hmm, and what is your config?

On Fri, Jul 8, 2011 at 11:57 AM, nachiket bhagwat <
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 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

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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM, nachiket bhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM, nachiket bhagwat <
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
http://uk.linkedin.com/in/paulloy

--

Paul Loy
p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

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/
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 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 wrote:

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

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 wrote:

hmm, and what is your config?

On Fri, Jul 8, 2011 at 11:57 AM,nachiketbhagwat <
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 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

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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM,nachiketbhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM,nachiketbhagwat <
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
http://uk.linkedin.com/in/paulloy

--

Paul Loy
p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

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.comwrote:

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/
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 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 wrote:

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

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 wrote:

hmm, and what is your config?

On Fri, Jul 8, 2011 at 11:57 AM,nachiketbhagwat <
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 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

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 =

(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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM,nachiketbhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement
NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM,nachiketbhagwat <
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
http://uk.linkedin.com/in/paulloy

--

Paul Loy
p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

--

Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy

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 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.comwrote:

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/
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 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 wrote:

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

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 wrote:

hmm, and what is your config?

On Fri, Jul 8, 2011 at 11:57 AM,nachiketbhagwat <
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 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

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 =

(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 wrote:

what was the output when you ran the jar command?

On Fri, Jul 8, 2011 at 4:40 AM,nachiketbhagwat
nachiketbhag...@gmail.comwrote:

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 wrote:

does UserRelativeScript extend/implement
NativeScriptFactory?

On Thu, Jul 7, 2011 at 10:18 AM,nachiketbhagwat <
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
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