# Unable to load script under config/scripts

**URL:** <https://discuss.elastic.co/t/unable-to-load-script-under-config-scripts/16264>\
**Category:** Elasticsearch\
**Created:** [March 10, 2014, 1:41pm UTC](https://discuss.elastic.co/t/unable-to-load-script-under-config-scripts/16264 "2014-03-10T13:41:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Bolis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_bolis/32/700_2.png) [@Thomas\_Bolis](https://discuss.elastic.co/u/Thomas_Bolis)\
**Post date:** [March 10, 2014, 1:41pm UTC](https://discuss.elastic.co/t/unable-to-load-script-under-config-scripts/16264/1 "2014-03-10T13:41:51Z")

</div>

Hi,

I'm trying to keep some scripts within config/scripts but elasticsearch  
seems that it cannot locate them. What could be a possible reason for this?

When need to invoke it es fails with the following

No such property: for class: Script1

Any ideas?

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f96b90e4-7704-49e0-8dd6-38ef1ebe6558%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f96b90e4-7704-49e0-8dd6-38ef1ebe6558%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 10, 2014, 5:00pm UTC](https://discuss.elastic.co/t/unable-to-load-script-under-config-scripts/16264/2 "2014-03-10T17:00:53Z")

</div>

Here's a basic example you can try:

> <https://gist.github.com/bly2k/9468905>

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7b06ee42-7bd1-41ab-a2eb-560949a86158%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7b06ee42-7bd1-41ab-a2eb-560949a86158%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Chris\_H1](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@Chris\_H1](https://discuss.elastic.co/u/Chris_H1)\
**Post date:** [April 14, 2014, 4:47pm UTC](https://discuss.elastic.co/t/unable-to-load-script-under-config-scripts/16264/3 "2014-04-14T16:47:24Z")

</div>

Thanks for posting the tutorial. I've been looking everywhere for this.  
I'm able to succeed with your tutorial, but I cannot get subdirectories to work.

So this fails with the bolded modifications. Am I misunderstanding how to notate directories?

Step 1:  
Under the **config/scripts/hw** folder, create a file named helloworld.mvel

Step 2:  
Edit the file helloworld.mvel and put this and save:  
"hello world"

Step 3:  
Restart Elasticsearch

Step 4:  
Test the script using a query like this:

curl -XPOST 'localhost:9200/test1/doc' -d '{ "test": "test" }'

curl 'localhost:9200/test1/\_search?pretty' -d '{  
"script\_fields": {  
"test": {  
**"script": "hw\_helloworld"**  
}  
}  
}'

---

<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, 1:35am UTC](https://discuss.elastic.co/t/unable-to-load-script-under-config-scripts/16264/4 "2017-07-06T01:35:54Z")

</div>


