aws / aws-sdk-java

The official AWS SDK for Java 1.x. The AWS SDK for Java 2.x is available here: https://github.com/aws/aws-sdk-java-v2/
https://aws.amazon.com/sdkforjava
Apache License 2.0
4.11k stars 2.83k forks source link

SearchRequestMarshaller used by AmazonCloudSearchDomainClient breaks when using certain structured queries #246

Closed maleldil closed 10 years ago

maleldil commented 10 years ago

This issue is reproducible in 1.8.3.

If you have a structured query string with any '=' in it the URL builder breaks, since it does String.split on equals signs and checks that there are only 2 values in the returned array (line 74 of SearchRequestMarshaller).

According to the documentation at http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-compound-queries.html the following query is valid:

q=(and (range field=year [2013,}) (or (term field=title boost=2 'star') (term field=plot 'star'))

But due to this bug instead I get "Cannot specify q.parser without q param (Service: AmazonCloudSearchDomain; Status Code: 400; Error Code: SearchException; Request ID: null)". Manually URL encoding the query string first also does not work.

maleldil commented 10 years ago

Closing this, I'll add a pull request with a fix momentarily