Search in sources :

Example 1 with SingleRepoStorageSource

use of com.enonic.xp.repo.impl.SingleRepoStorageSource 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

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