Not sure if this helps, but I did find a related post on proximity search with wildcard and terms that might be worth a look to see if it helps with your issue. If that approach is helpful it might mean you don't need to write the plugin.
As an aside, if you're looking for documentation on writing Java code connecting to Elasticsearch, I would have a look at the Elasticsearch Java API client documentation.