I have some search queries like so:
George AND NOT Washington OR Abraham
Dog OR cat AND NOT Wolf
for these searches I would want to get back results for George or Abraham but not Washington, etc.
basically I want to take the string and be able to submit a contextual search to my full-text catalog stored procedure search.
I am assuming I should use Regex but I am very unfamiliar with Regex in C#.
I found this article: http://support.microsoft.com/kb/246800 which I think is what I need to do, but I was hoping that I could have some help with the implementation.
Assuming you take a string as parameter and would like to return a string:
string input = 'George Washington AND NOT Martha OR Dog';
private string interpretSearchQuery(input)
{
// HALP!
/* replace ' AND ' | ' AND NOT ' with
* " AND "
* " AND NOT "
*
* replace ' OR ' | ' OR NOT ' with
* " OR "
* " OR NOT "
*
* add " to beginning of string and " to end of string
*/
return '"George Washington" AND NOT "Martha" OR "Dog"';
}