package org.vertexium.elasticsearch;

import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.index.query.FilterBuilder;
import org.elasticsearch.index.query.FilterBuilders;
import org.vertexium.*;
import org.vertexium.elasticsearch.score.ScoringStrategy;
import org.vertexium.query.QueryParameters;
import org.vertexium.query.VertexQuery;

import java.util.List;
import java.util.Map;

import static org.vertexium.util.IterableUtils.toArray;

public class ElasticSearchSearchVertexQuery extends ElasticSearchSearchQueryBase implements VertexQuery {
    private final Vertex sourceVertex;

    public ElasticSearchSearchVertexQuery(
            TransportClient client,
            Graph graph,
            Vertex sourceVertex,
            String queryString,
            Map<String, PropertyDefinition> propertyDefinitions,
            ScoringStrategy scoringStrategy,
            IndexSelectionStrategy indexSelectionStrategy,
            Authorizations authorizations
    ) {
        super(client, graph, queryString, propertyDefinitions, scoringStrategy, indexSelectionStrategy, authorizations);
        this.sourceVertex = sourceVertex;
    }

    @Override
    protected List<FilterBuilder> getFilters(QueryParameters queryParameters, ElasticSearchElementType elementType) {
        List<FilterBuilder> results = super.getFilters(queryParameters, elementType);
        if (elementType.equals(ElasticSearchElementType.VERTEX)) {
            String[] ids = toArray(sourceVertex.getVertexIds(Direction.BOTH, getParameters().getAuthorizations()), String.class);
            results.add(FilterBuilders.idsFilter().ids(ids));
        }
        return results;
    }
}


@@ -281,52 +281,8 @@
 gy;%0A
-import org.vertexium.query.QueryParameters;%0A
 impo
@@ -1188,41 +1188,8 @@
 ers(
-QueryParameters queryParameters, 
 Elas
@@ -1283,25 +1283,8 @@
 ers(
-queryParameters, 
 elem

fix compiler error