Unable to create index::
*No alternatives found. Query: select [rep:Authorizable].[rep:principalName]
as [rep:Authorizable.rep:principalName],
[rep:Authorizable].[rep:authorizableId] as
[rep:Authorizable.rep:authorizableId], [rep:Authorizable].[jcr:uuid] as
[rep:Authorizable.jcr:uuid], [rep:Authorizable].[jcr:primaryType] as
[rep:Authorizable.jcr:primaryType], [rep:Authorizable].[jcr:created] as
[rep:Authorizable.jcr:created], [rep:Authorizable].[jcr:createdBy] as
[rep:Authorizable.jcr:createdBy] from [rep:Authorizable] as
[rep:Authorizable] where [rep:Authorizable].[rep:principalName] =
$principalName*
And the equivalent index definition,
/
- compatVersion = 2
- async = "async"
- jcr:primaryType = oak:QueryIndexDefinition
- type = "lucene"
+ indexRules
+ rep:Authorizable
+ properties
+ principalName
- name = "rep:principalName"
- propertyIndex = true/
Oak API to create Index:
*Node indexDef = JcrUtils.getOrCreateByPath("/oak:index/"+indexName,
"oak:Unstructured","oak:QueryIndexDefinition", session,true);
indexDef.setProperty("compatVersion", 2);
indexDef.setProperty("type", "lucene");
indexDef.setProperty("async", "async");
Node indexRules = indexDef.addNode(LuceneIndexConstants.INDEX_RULES);
Node authorizable = indexRules.addNode("rep:Authorizable");
Node properties = authorizable.addNode("properties");
Node principalName = properties.addNode("principalName");
principalName.setProperty("name","rep:principalName");
principalName.setProperty("propertyIndex",true);
*
Fails and every API call complaints on 'No alternatives found'
Could someone help?
<oak.version>1.5.18</oak.version>
--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html