Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2713

Creating an index programmatically using the local index provider always sets workspace match to '*' (match all workspaces)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Indexing
    • None
    • Hide

      IndexManager indexManager = ((org.modeshape.jcr.api.Workspace)session.getWorkspace()).getIndexManager();

      IndexDefinitionTemplate nodeByTypeIndexDefinitionTemplate = indexManager.createIndexDefinitionTemplate();
      nodeByTypeIndexDefinitionTemplate.setName("nodeByType_" + session.getWorkspace().getName());
      nodeByTypeIndexDefinitionTemplate.setWorkspace(session.getWorkspace().getName());
      nodeByTypeIndexDefinitionTemplate.setKind(IndexKind.NODE_TYPE);
      nodeByTypeIndexDefinitionTemplate.setProviderName("local");
      nodeByTypeIndexDefinitionTemplate.setNodeTypeName("nt:base");
      nodeByTypeIndexDefinitionTemplate.setColumnDefinitions(indexManager.createIndexColumnDefinitionTemplate().setPropertyName("jcr:primaryType").setColumnType(PropertyType.STRING));
      nodeByTypeIndexDefinitionTemplate.setSynchronous(true);

      however, the debug log shows:
      2017-09-22 09:57:31,800 DEBUG [localhost-startStop-1] org.modeshape.jcr.index.local.LocalIndexProvider - Index provider
      'local' is creating index in workspace 'testy': nodesByParentId@local nodeType=nt:base column=jcr:parent(STRING) kind=VALUE sync=true workspaces=*

      Show
      IndexManager indexManager = ((org.modeshape.jcr.api.Workspace)session.getWorkspace()).getIndexManager(); IndexDefinitionTemplate nodeByTypeIndexDefinitionTemplate = indexManager.createIndexDefinitionTemplate(); nodeByTypeIndexDefinitionTemplate.setName("nodeByType_" + session.getWorkspace().getName()); nodeByTypeIndexDefinitionTemplate.setWorkspace(session.getWorkspace().getName()); nodeByTypeIndexDefinitionTemplate.setKind(IndexKind.NODE_TYPE); nodeByTypeIndexDefinitionTemplate.setProviderName("local"); nodeByTypeIndexDefinitionTemplate.setNodeTypeName("nt:base"); nodeByTypeIndexDefinitionTemplate.setColumnDefinitions(indexManager.createIndexColumnDefinitionTemplate().setPropertyName("jcr:primaryType").setColumnType(PropertyType.STRING)); nodeByTypeIndexDefinitionTemplate.setSynchronous(true); however, the debug log shows: 2017-09-22 09:57:31,800 DEBUG [localhost-startStop-1] org.modeshape.jcr.index.local.LocalIndexProvider - Index provider 'local' is creating index in workspace 'testy': nodesByParentId@local nodeType=nt:base column=jcr:parent(STRING) kind=VALUE sync=true workspaces=*

      When programmatically assigning a local index provider, the value for the workspace match is always set to '*'.

              Unassigned Unassigned
              rabo_jira r b (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: