Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 682
virender Avatar asked Nov 08 '22 18:11

virender


1 Answers

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!

like image 168
kevlaria Avatar answered Nov 15 '22 12:11

kevlaria