class LegacyDetectorRepositoryImpl implements LegacyDetectorRepository {

    @Override
    public List<DetectorDocument> findByCreatedBy(String user) {
        val queryBuilder = QueryBuilders.termQuery("createdBy", user);
        val searchSourceBuilder = elasticsearchUtil.getSourceBuilder(queryBuilder).size(DEFAULT_ES_RESULTS_SIZE);
        val searchRequest = elasticsearchUtil.getSearchRequest(searchSourceBuilder, DETECTOR_INDEX, DETECTOR_DOC_TYPE);
        return getDetectorsFromElasticSearch(searchRequest);
    }

}