Refactor ElasticSearch query builder to use OSGi services