Searching for Ampersand

May 16, 2014 at 5:07 PM
i want to do a search for tweets that contain a specific set of characters including an ampersand. for example i want to search for any tweet with "B&H" in the tweet. when i do a search for "B&H" what is returned is tweets with b or h but not the ampersand. i have tried URL encoding the ampersand, putting it in quotes and other operators with no success. does anyone have any ideas on how to make this happen?

Thanks

CODE BELOW

 try
                {
                    var searchResponse =
                       await
                       (from search in twitterCtx.Search
                        where search.Type == SearchType.Search &&
                              search.Query == "\"B&H\""
                        select search)
                       .SingleOrDefaultAsync();

                            if (searchResponse != null && searchResponse.Statuses != null)
                                searchResponse.Statuses.ForEach(tweet =>
                                    Console.WriteLine(
                                        "User: {0}, Tweet: {1}",
                                        tweet.User.ScreenNameResponse,
                                        tweet.Text));
                        }
                catch (TwitterQueryException tqe)
                {
                    Console.WriteLine(tqe.Message);
                }
```
Coordinator
May 19, 2014 at 12:40 AM
Hi,

Twitter API Search isn't a robust search engine like Bing or Google. LINQ to Twitter is a 3rd party library that just passes your text to the Twitter API and returns the results and has no affect on the internal Twitter API processing.

@JoeMayo