Elasticsearch uses lucene indexes where schema is applied at index time. This results in painful structuring of data, painful learning of search syntax, and yes it's also faster in many cases. Elasticsearch has an API call too.
However, Splunk can be fast too. It's much easier to build and expand horizontally, has a much easier search syntax, and many more enterprise level features out of the box.
You should share your architecture, java code, sample data, and how you're loading your data into splunk (inputs, props, transforms, etc) so that we can teach you how to get quicker results