Is there a reason you put this code in es_component? es_component is usually only for functions shared between two or more of Server, Index, or IndexType. Otherwise the code should probably just go straight in server.rb