I managed to do it this way in my application (to change the icon, but you can probably adapt it to hide it). If someone has an easier way, I'll be glad to hear it (like in XML for example).
try {
Resources resources = this.getResources();
int id = resources.getIdentifier("search_src_text", "id", "android");
View autoComplete = searchView.findViewById(id);
Class<?> clazz = Class.forName("android.widget.SearchView$SearchAutoComplete");
Method textSizeMethod = clazz.getMethod("getTextSize");
Float rawTextSize = (Float) textSizeMethod.invoke(autoComplete);
int textSize = (int) (rawTextSize * 1.25);
Drawable searchIcon = resources.getDrawable(R.drawable.ic_action_search);
searchIcon.setBounds(0, 0, textSize, textSize);
SpannableStringBuilder stopHint = new SpannableStringBuilder(" ");
stopHint.append(this.getString(R.string.search_quotes));
stopHint.setSpan(new ImageSpan(searchIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
Method setHintMethod = clazz.getMethod("setHint", CharSequence.class);
setHintMethod.invoke(autoComplete, stopHint);
}
catch (Exception exception) {
exception.printStackTace();
}
From How to style the ActionBar SearchView programmatically.