Solr Search On Exact Phrase
Very brief code sample of how to perform a exact phrase match query in Solr.
Using the Solr Admin's Query tool to perform a search on a field, you will notice that Solr splits each word into a token to search on.
Solr Admin Query
Most of the time this is the desired functionality, however there could be times where you want to return results where the exact phrase is matched. If you perform a search wrapping quotes around the phrase within the Solr Admin Query tool, Solr will perform a query looking for an exact match on the phrase (see screenshot below, notice the reduced number of results).
Solr Admin Phase Search With Quotes
Below is a code sample of how to perform a search using Sitecore 7's Content Search API's. The code checks whether the keywords searched upon start and end with quotes. If the quotes are present, the keywords are then passed into the search intact with the quotes present. If the quotes aren't present the keywords are split into an array on a space and the search is performed as normal.