virender
virender

Reputation: 4647

Querying string with apostrophe in Cloud Search

I have string 'Vick's' that I need to pass to the cloud search using the API. But when I passing it to the API it throws an error. When I am using 'Vick's' instead of Vick's as a search string it is not giving exact result. The search for on the other hand 'Vick%27s' is working fine.

When I am in the Amazon and doing some searches there, they turn out fine for "Vick's" and "Vick\'s". I am using Amazing Cloud Search wrapper, which written in C#.

My question is: How to querying string with apostrophe in cloud search?

Upvotes: 5

Views: 1043

Answers (1)

kevlaria
kevlaria

Reputation: 33

You'll need to prepend your ' with a slash (\'). And if you're using Java, and you're doing replaceAll, you'll need to do something along the lines of .replaceAll("'", "\\'") (4 slashes - even though only 2 appear here!).

Hope it helps!

Upvotes: 1

Related Questions