How do I remove search categories (Dialog, Keywords, Project, Notes) from the search bar?
A search bar with fewer search categories can be useful in a small size Mail window. The regular search bar on a regular size Mail window looks as follows:

Turn search categories (Dialog, Keyword, Project, Notes) off with the following terminal commands:
defaults write ca.indev.MailTags
mailTagsSuppressConversationSearch 1
defaults write ca.indev.MailTags mailTagsSuppressKeywordSearch
1
defaults write ca.indev.MailTags mailTagsSuppressProjectSearch
1
defaults write ca.indev.MailTags mailTagsSuppressNoteSearch 1
You can choose which ones to turn off.
Turn them on again with
defaults write ca.indev.MailTags item 0
BTW if you do have them turned off, you can still perform
keyword, project, note and conversation searches within the search
term itself using a field:term syntax and selecting the Entire
Message filter
for example
kw: term
p: term
note: term
conversation: term