protected NodeSequence createNodeSequenceForSource( QueryCommand originalQuery,
                                                        QueryContext context,
                                                        PlanNode sourceNode,
                                                        IndexPlan index,
                                                        Columns columns,
                                                        QuerySources sources ) {
        if (index.getProviderName() == null) {
            String name = index.getName();
            String pathStr = (String)index.getParameters().get(IndexPlanners.PATH_PARAMETER);
            if (pathStr != null) {
                if (IndexPlanners.NODE_BY_PATH_INDEX_NAME.equals(name)) {
                    PathFactory paths = context.getExecutionContext().getValueFactories().getPathFactory();
                    Path path = paths.create(pathStr);
                    return sources.singleNode(path, 1.0f);
                }
                if (IndexPlanners.CHILDREN_BY_PATH_INDEX_NAME.equals(name)) {
                    PathFactory paths = context.getExecutionContext().getValueFactories().getPathFactory();
                    Path path = paths.create(pathStr);
                    return sources.childNodes(path, 1.0f);
                }
                if (IndexPlanners.DESCENDANTS_BY_PATH_INDEX_NAME.equals(name)) {
                    PathFactory paths = context.getExecutionContext().getValueFactories().getPathFactory();
                    Path path = paths.create(pathStr);
                    return sources.descendantNodes(path, 1.0f);
                }
            }
            String idStr = (String)index.getParameters().get(IndexPlanners.ID_PARAMETER);
            if (idStr != null) {
                if (IndexPlanners.NODE_BY_ID_INDEX_NAME.equals(name)) {
                    StringFactory string = context.getExecutionContext().getValueFactories().getStringFactory();
                    String id = string.create(idStr);
                    final String workspaceName = context.getWorkspaceNames().iterator().next();
                    return sources.singleNode(workspaceName, id, 1.0f);
                }
            }
        }
        return null;
    }
protected NodeSequence createNodeSequenceForSource ( QueryCommand originalQuery , QueryContext context , PlanNode sourceNode , IndexPlan index , Columns columns , QuerySources sources ) { if ( index . getProviderName ( ) == null ) { String name = index . getName ( ) ; String pathStr = ( String ) index . getParameters ( ) . get ( IndexPlanners . PATH_PARAMETER ) ; if ( pathStr != null ) { if ( IndexPlanners . NODE_BY_PATH_INDEX_NAME . equals ( name ) ) { PathFactory paths = context . getExecutionContext ( ) . getValueFactories ( ) . getPathFactory ( ) ; Path path = paths . create ( pathStr ) ; return sources . singleNode ( path , 1.0f ) ; } if ( IndexPlanners . CHILDREN_BY_PATH_INDEX_NAME . equals ( name ) ) { PathFactory paths = context . getExecutionContext ( ) . getValueFactories ( ) . getPathFactory ( ) ; Path path = paths . create ( pathStr ) ; return sources . childNodes ( path , 1.0f ) ; } if ( IndexPlanners . DESCENDANTS_BY_PATH_INDEX_NAME . equals ( name ) ) { PathFactory paths = context . getExecutionContext ( ) . getValueFactories ( ) . getPathFactory ( ) ; Path path = paths . create ( pathStr ) ; return sources . descendantNodes ( path , 1.0f ) ; } } String idStr = ( String ) index . getParameters ( ) . get ( IndexPlanners . ID_PARAMETER ) ; if ( idStr != null ) { if ( IndexPlanners . NODE_BY_ID_INDEX_NAME . equals ( name ) ) { StringFactory string = context . getExecutionContext ( ) . getValueFactories ( ) . getStringFactory ( ) ; String id = string . create ( idStr ) ; final String workspaceName = context . getWorkspaceNames ( ) . iterator ( ) . next ( ) ; return sources . singleNode ( workspaceName , id , 1.0f ) ; } } } return null ; }
Create a node sequence for the given index

@param originalQuery the original query command; may not be null
@param context the context in which the query is to be executed; may not be null
@param sourceNode the {@link Type#SOURCE} plan node for one part of a query; may not be null
@param index the {@link IndexPlan} specification; may not be null
@param columns the result column definition; may not be null
@param sources the query sources for the repository; may not be null
@return the sequence of results; null only if the type of index is not understood