Optimizing the electric field around solid and core-shell alloy nanostructures for near-field applications.