# Java Api: run Action on specific Index

**URL:** <https://discuss.elastic.co/t/java-api-run-action-on-specific-index/84621>\
**Category:** Elasticsearch\
**Created:** [May 4, 2017, 7:23pm UTC](https://discuss.elastic.co/t/java-api-run-action-on-specific-index/84621 "2017-05-04T19:23:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m6800](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@m6800](https://discuss.elastic.co/u/m6800)\
**Post date:** [May 4, 2017, 7:23pm UTC](https://discuss.elastic.co/t/java-api-run-action-on-specific-index/84621/1 "2017-05-04T19:23:43Z")

</div>

I am trying to figure out how to specify which index to run my custom Action on. I have a class based off of BaseRestHandler that handles the Rest request. It properly handles the request only on the index that is specified in the URL command, however when my Action is called, it runs on all available indices.

Is there a way to prevent this that I have overlooked? I am using Elastic search 2.4.4.

Thanks!

---

<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:** [June 1, 2017, 7:30pm UTC](https://discuss.elastic.co/t/java-api-run-action-on-specific-index/84621/2 "2017-06-01T19:30:36Z")

</div>

Closed on June 1, 2017, 7:30pm UTC

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