Thanks to @heyjudeonline for the link to a site called Shakespeare Searched. The database is helped by the Folger Shakespeare Library, and you can use it to search for words or themes by play or by character. You can search within plays, or search through all of the Bards works.
Here is an image from my screen after searching for Macbeth, then browsing through quotes containing the word traitor: