Search in sources :

Example 1 with NodeBranchQueryResult

use of com.enonic.xp.repo.impl.branch.search.NodeBranchQueryResult in project xp by enonic.

the class GetBranchDataCommand method execute.

public NodeBranchEntries execute() {
    final SearchResult result = doExecute();
    final NodeBranchQueryResult nodeBranchEntries = NodeBranchQueryResultFactory.create(result);
    return NodeBranchEntries.from(nodeBranchEntries.getList());
}
Also used : NodeBranchQueryResult(com.enonic.xp.repo.impl.branch.search.NodeBranchQueryResult) SearchResult(com.enonic.xp.repo.impl.search.result.SearchResult)

Example 2 with NodeBranchQueryResult

use of com.enonic.xp.repo.impl.branch.search.NodeBranchQueryResult in project xp by enonic.

the class BranchServiceImpl method getIgnoreOrder.

private NodeBranchEntries getIgnoreOrder(final NodeIds nodeIds, final InternalContext context) {
    if (nodeIds.isEmpty()) {
        return NodeBranchEntries.empty();
    }
    final SearchResult results = this.searchDao.search(SearchRequest.create().query(NodeBranchQuery.create().addQueryFilter(ValueFilter.create().fieldName(BranchIndexPath.BRANCH_NAME.getPath()).addValue(ValueFactory.newString(context.getBranch().getValue())).build()).addQueryFilter(IdFilter.create().fieldName(BranchIndexPath.NODE_ID.getPath()).values(nodeIds).build()).size(nodeIds.getSize()).build()).returnFields(BRANCH_RETURN_FIELDS).searchSource(new SingleRepoStorageSource(context.getRepositoryId(), SingleRepoStorageSource.Type.BRANCH)).searchPreference(context.getSearchPreference()).build());
    final NodeBranchQueryResult nodeBranchEntries = NodeBranchQueryResultFactory.create(results);
    return NodeBranchEntries.from(nodeBranchEntries.getList());
}
Also used : SingleRepoStorageSource(com.enonic.xp.repo.impl.SingleRepoStorageSource) NodeBranchQueryResult(com.enonic.xp.repo.impl.branch.search.NodeBranchQueryResult) SearchResult(com.enonic.xp.repo.impl.search.result.SearchResult)

Aggregations

NodeBranchQueryResult (com.enonic.xp.repo.impl.branch.search.NodeBranchQueryResult)2 SearchResult (com.enonic.xp.repo.impl.search.result.SearchResult)2 SingleRepoStorageSource (com.enonic.xp.repo.impl.SingleRepoStorageSource)1