fix use or not of elasticsearch