core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMatchStatement.java
public Object execute(OSQLAsynchQuery<ODocument> request, OCommandContext context, OProgressListener progressListener) {
    if (orderBy != null) {
      throw new OCommandExecutionException("ORDER BY is not supported in MATCH on the legacy API");
    }
    if (groupBy != null) {
      throw new OCommandExecutionException("GROUP BY is not supported in MATCH on the legacy API");
    }
    if (unwind != null) {
      throw new OCommandExecutionException("UNWIND is not supported in MATCH on the legacy API");
    }
    if (skip != null) {
      throw new OCommandExecutionException("SKIP is not supported in MATCH on the legacy API");
    }

    Map<Object, Object> iArgs = context.getInputParameters();
    try {

      Map<String, Long> estimatedRootEntries = estimateRootEntries(aliasClasses, aliasFilters, context);
      if (estimatedRootEntries.values().contains(0l)) {
        return new OBasicLegacyResultSet();// some aliases do not match on any classes
      }

      List<EdgeTraversal> sortedEdges = getTopologicalSortedSchedule(estimatedRootEntries, pattern);
      MatchExecutionPlan executionPlan = new MatchExecutionPlan();
      executionPlan.sortedEdges = sortedEdges;

      calculateMatch(pattern, estimatedRootEntries, new MatchContext(), aliasClasses, aliasFilters, context, request,
          executionPlan);

      return getResult(request);
    } finally {
      if (request.getResultListener() != null) {
        request.getResultListener().end();
      }
    }

  }
public Object execute(OSQLAsynchQuery<ODocument> request, OCommandContext context, OProgressListener progressListener) {
    if (orderBy != null) {
      throw new OCommandExecutionException("ORDER BY is not supported in MATCH on the legacy API");
    }
    if (groupBy != null) {
      throw new OCommandExecutionException("GROUP BY is not supported in MATCH on the legacy API");
    }
    if (unwind != null) {
      throw new OCommandExecutionException("UNWIND is not supported in MATCH on the legacy API");
    }
    if (skip != null) {
      throw new OCommandExecutionException("SKIP is not supported in MATCH on the legacy API");
    }

    Map<Object, Object> iArgs = context.getInputParameters();
    try {

      Map<String, Long> estimatedRootEntries = estimateRootEntries(aliasClasses, aliasFilters, context);
      if (estimatedRootEntries.values().contains(0l)) {
        return new OBasicLegacyResultSet();// some aliases do not match on any classes
      }

      List<EdgeTraversal> sortedEdges = getTopologicalSortedSchedule(estimatedRootEntries, pattern);
      MatchExecutionPlan executionPlan = new MatchExecutionPlan();
      executionPlan.sortedEdges = sortedEdges;

      calculateMatch(pattern, estimatedRootEntries, new MatchContext(), aliasClasses, aliasFilters, context, request,
          executionPlan);

      return getResult(request);
    } finally {
      if (request.getResultListener() != null) {
        request.getResultListener().end();
      }
    }

  }
executes the match statement. This is the preferred execute() method and it has to be used as the default one in the future.
This method works in stateless mode

@param request
@param context

@return