elasticsearch/elasticsearch — Issue #1544: support multiple uri params with same name
Author: mattweber
Created: 2011-12-15 16:28:14+00:00
State: open

When working on a plugin that requires the use of passing multiple uri parameters with the same name, I found that ES only honors the last parameter.

¶m=1¶m=2

In a RestRequest, calling param("param") will result in 2, completely ignoring the first parameter. I was going to write a patch for this that modifies the decodeQueryString of RestUtils to append multiple values with a comma so that we can use the paramAsStringArray to get each value. This might not be the best approach considering a parameter value can have a comma in the value.

Netty has a utility class org.jboss.netty.handler.codec.http.QueryStringDecoder that could be used. It returns params as a list of strings. Would it be better to create a multiParams variable that uses this and leave the old params in place for backwards compatibility?