homeaway / thunderhead

Thunderhead - An AWS Cloudsearch client for uploading documents and querying your search domains written in Java
http://homeaway.github.io/thunderhead
Other
2 stars 2 forks source link

patchReturnFields in CloudSearchReadClient doesn't really make sense... #11

Closed bryonjacob closed 11 years ago

bryonjacob commented 11 years ago

in CloudSearchReadClient, you added the patchReturnFields with this comment:

/* Don't like doing this but apparently jersey has problems with return-fields being in multivalued map */

that's not true, jersey handles multi-valued query params just fine. but CloudSearch doesn't support accepting multiple values for the return-fields parameter - the API doc says that this is a comma-delimited list of return fields:

http://docs.aws.amazon.com/cloudsearch/latest/developerguide/Search.Requests.html#Search.ReqParams

So, the fact that you're putting multiple values of that param, and then unwinding them into a comma-separated list here, is a bit strange. I would suggest that since you're exposing the raw multi-valued-map of params to your end user, you should expect the user to give you a comma-separated single value for that param, and you should get rid of this "patch" method altogether.

jmoney commented 11 years ago

I must have missed this part of the documentation(or just did not understand it properly). This method can be removed with the assumption that the user will be responsible for formatting it correctly. This should all go away once https://github.com/homeaway/thunderhead/issues/8 is completed.