revamped code to use the latest elasticsearch client.  also added test