# How can I access script field in map script of facet script plugin?

**URL:** <https://discuss.elastic.co/t/how-can-i-access-script-field-in-map-script-of-facet-script-plugin/15327>\
**Category:** Elasticsearch\
**Created:** [January 20, 2014, 7:45pm UTC](https://discuss.elastic.co/t/how-can-i-access-script-field-in-map-script-of-facet-script-plugin/15327 "2014-01-20T19:45:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kajal](https://avatars.discourse-cdn.com/v4/letter/k/7993a0/32.png) [@kajal](https://discuss.elastic.co/u/kajal)\
**Post date:** [January 20, 2014, 7:45pm UTC](https://discuss.elastic.co/t/how-can-i-access-script-field-in-map-script-of-facet-script-plugin/15327/1 "2014-01-20T19:45:42Z")

</div>

## I need to use the script field value in my map script. I am not sure how can i access that. My query looks like this, I need to use value of state\_info into my map\_REPORT script. Is it possible to access that?? { "query": {

},  
"script\_fields": {  
"state\_info" : { "script" : "lookup", "lang" : native", "parems" :{  
"field" : "state"}}  
},  
"facets": {  
"reportFacet": {  
"script": {  
"init\_script": "init\_REPORT",  
"map\_script": "map\_REPORT",  
"reduce\_script": "reduce\_REPORT",  
"params": {  
--  
}  
}  
}  
}  
}

--  
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/82332df4-a4a0-4e3b-8439-cdeb3a6bf3de%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/82332df4-a4a0-4e3b-8439-cdeb3a6bf3de%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:55am UTC](https://discuss.elastic.co/t/how-can-i-access-script-field-in-map-script-of-facet-script-plugin/15327/2 "2017-07-06T01:55:47Z")

</div>


