# RestAction paths/registrations overwriting each other

**URL:** <https://discuss.elastic.co/t/restaction-paths-registrations-overwriting-each-other/6195>\
**Category:** Elasticsearch\
**Created:** [December 20, 2011, 3:21pm UTC](https://discuss.elastic.co/t/restaction-paths-registrations-overwriting-each-other/6195 "2011-12-20T15:21:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Reelsen](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexander\_Reelsen](https://discuss.elastic.co/u/Alexander_Reelsen)\
**Post date:** [December 20, 2011, 3:21pm UTC](https://discuss.elastic.co/t/restaction-paths-registrations-overwriting-each-other/6195/1 "2011-12-20T15:21:38Z")

</div>

Hi,

I have a problem registering a controller handler directly under the  
root URL. I try to call this in my RestAction

controller.registerHandler(POST, "/\_suggestRefresh", this);

However the RestIndexAction seems to overwrite my controller  
registration, where as the RestIndicesAliasesAction works as expected.  
Is this something which is due to the loading order of the  
controllers?

This results that I always get an error like this (coming from the  
RestIndexAction):

{"error":"InvalidIndexNameException[[\_suggestRefresh] Invalid index  
name [_suggestRefresh], must not start with '_']","status":400}

Any tips how I can change this behaviour? Am I doing some stupid  
mistake? 🙂

Thanks for helping!

--Alexander

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 20, 2011, 3:43pm UTC](https://discuss.elastic.co/t/restaction-paths-registrations-overwriting-each-other/6195/2 "2011-12-20T15:43:45Z")

</div>

Actual constants will be preferred compared to wildcards when registering  
an action, so if you provide /\_suggestRefresh your action will be executed.  
Are you sure you are registering the action / using the correct http verb?  
This is done in many places in elasticsearch (like /\_optimize, or  
/\_refresh).

On Tue, Dec 20, 2011 at 5:21 PM, Alexander Reelsen \<  
[alexander.reelsen@googlemail.com](mailto:alexander.reelsen@googlemail.com)\> wrote:

> Hi,
> 
> I have a problem registering a controller handler directly under the  
> root URL. I try to call this in my RestAction
> 
> controller.registerHandler(POST, "/\_suggestRefresh", this);
> 
> However the RestIndexAction seems to overwrite my controller  
> registration, where as the RestIndicesAliasesAction works as expected.  
> Is this something which is due to the loading order of the  
> controllers?
> 
> This results that I always get an error like this (coming from the  
> RestIndexAction):
> 
> {"error":"InvalidIndexNameException[[\_suggestRefresh] Invalid index  
> name [_suggestRefresh], must not start with '_']","status":400}
> 
> Any tips how I can change this behaviour? Am I doing some stupid  
> mistake? 🙂
> 
> Thanks for helping!
> 
> --Alexander

---

<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, 3:44am UTC](https://discuss.elastic.co/t/restaction-paths-registrations-overwriting-each-other/6195/3 "2017-07-06T03:44:52Z")

</div>

Closed on July 6, 2017, 3:44am UTC


