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());
}
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());
}
Aggregations