コード例 #1
0
  FindContentIdsByQueryResult execute() {
    final NodeQuery nodeQuery =
        ContentQueryNodeQueryTranslator.translate(this.query)
            .addQueryFilters(createFilters())
            .build();

    final FindNodesByQueryResult result = nodeService.findByQuery(nodeQuery);

    return FindContentIdsByQueryResult.create()
        .contents(ContentNodeHelper.toContentIds(result.getNodeIds()))
        .aggregations(result.getAggregations())
        .hits(result.getHits())
        .totalHits(result.getTotalHits())
        .build();
  }
コード例 #2
0
  FindContentByQueryResult execute() {
    final NodeQuery nodeQuery =
        ContentQueryNodeQueryTranslator.translate(this.params.getContentQuery())
            .addQueryFilters(createFilters())
            .build();

    final FindNodesByQueryResult result = nodeService.findByQuery(nodeQuery);

    final NodeIds nodeIds = result.getNodeIds();

    final Nodes foundNodes = this.nodeService.getByIds(nodeIds);

    Contents contents = this.translator.fromNodes(foundNodes, true);

    return FindContentByQueryResult.create()
        .contents(contents)
        .aggregations(result.getAggregations())
        .hits(result.getHits())
        .totalHits(result.getTotalHits())
        .build();
  }