# Getting the value of a doc field inside FilterScript plugin

**URL:** <https://discuss.elastic.co/t/getting-the-value-of-a-doc-field-inside-filterscript-plugin/275819>\
**Category:** Elasticsearch\
**Created:** [June 14, 2021, 10:20am UTC](https://discuss.elastic.co/t/getting-the-value-of-a-doc-field-inside-filterscript-plugin/275819 "2021-06-14T10:20:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsena](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lsena/32/90252_2.png) [@lsena](https://discuss.elastic.co/u/lsena)\
**Post date:** [June 14, 2021, 10:20am UTC](https://discuss.elastic.co/t/getting-the-value-of-a-doc-field-inside-filterscript-plugin/275819/1 "2021-06-14T10:20:49Z")

</div>

Hi! I need to fetch the value of the \_id (or other doc fields).

Currently, I'm doing it like this:

> <https://github.com/lsena/fastfilter-elasticsearch-plugin/blob/master/src/main/java/org/elasticsearch/lsena/fastfilter/FastFilterPlugin.java#L157>

Is this the proper way to do it? It feels wrong. Especially fetching \_id since it even throws a warning about the deprecation of using \_id in aggregations.

Unfortunately, Elasticsearch plugin documentation is almost inexistent ☹

---

<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 12, 2021, 10:21am UTC](https://discuss.elastic.co/t/getting-the-value-of-a-doc-field-inside-filterscript-plugin/275819/2 "2021-07-12T10:21:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
