Package org.sonar.server.search.ws

Examples of org.sonar.server.search.ws.SearchOptions


  }

  @Override
  public void handle(Request request, Response response) {
    ActivityQuery query = logService.newActivityQuery();
    SearchOptions searchOptions = SearchOptions.create(request);
    QueryContext queryContext = mapping.newQueryOptions(searchOptions);

    Result<Activity> results = logService.search(query, queryContext);

    JsonWriter json = response.newJsonWriter().beginObject();
    searchOptions.writeStatistics(json, results);
    writeLogs(results, json, searchOptions);
    json.endObject().close();
  }
View Full Code Here


  }

  @Override
  public void handle(Request request, Response response) {
    RuleQuery query = createRuleQuery(ruleService.newRuleQuery(), request);
    SearchOptions searchOptions = SearchOptions.create(request);
    QueryContext queryContext = mapping.newQueryOptions(searchOptions);
    Boolean facets = request.paramAsBoolean(PARAM_FACETS);
    if (facets != null && facets) {
      queryContext.addFacets(Arrays.asList("languages", "repositories", "tags"));
    }

    Result<Rule> results = ruleService.search(query, queryContext);

    JsonWriter json = response.newJsonWriter().beginObject();
    searchOptions.writeStatistics(json, results);
    writeRules(results, json, searchOptions);
    if (searchOptions.hasField("actives")) {
      activeRuleCompleter.completeSearch(query, results.getHits(), json);
    }
    if (queryContext.isFacet()) {
      writeFacets(results, json);
    }
View Full Code Here

    checkUserRights();

    ActivityQuery query = logService.newActivityQuery();
    query.setTypes(Arrays.asList(Activity.Type.ANALYSIS_REPORT));

    SearchOptions searchOptions = SearchOptions.create(request);
    QueryContext queryContext = mapping.newQueryOptions(searchOptions);

    Result<Activity> results = logService.search(query, queryContext);

    JsonWriter json = response.newJsonWriter().beginObject();
    searchOptions.writeStatistics(json, results);
    writeReports(results, json, searchOptions);
    json.endObject().close();
  }
View Full Code Here

TOP

Related Classes of org.sonar.server.search.ws.SearchOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.