Set custom analyzer with Java API

Eventually I found the solution. The problem was that the analyzer field contained an array of objects, however that must be strictly an object.