Perhaps I'm blind but I can't find any documentation on escaping special characters for Sitecore's fast query.
For example, I want to search content items that contain the following text in their description: "hot n' tasty"
Note: I've tried the following escaping:
var searchTerm = "hot n'' tasty"; // thought it might need to be escaped for sql
var searchTerm = "#hot n' tasty#"; // this is how you do some other sitecore escaping
var searchTerm = "hot n\' tasty";
Sample application code:
var searchTerm = "hot n' tasty";
var query = string.Format("fast:/sitecore/content/Home/Products//*[@ContentDescriptionText='%{0}%']", searchTerm);
var items = Database.SelectItems(query);
Currently, this is giving me an exception so I'm assuming I need to do some sort of escaping:
"]" expected at position 67.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Sitecore.Data.Query.ParseException: "]" expected at position 67.