Thank you for your reply!
Setting the :childOrder helps reduce the warning logs. I am still
getting these log entries a lot;
16:38:00,016 TRACE lucene.IndexDefinition.collectIndexRules() - line
519 [] - Found rule 'IndexRule: ka:asset' for NodeType 'ka:asset'
16:38:00,016 TRACE lucene.IndexDefinition.collectIndexRules() - line
535 [] - Registering rule 'IndexRule: ka:asset' for name 'ka:asset'
I am unsure why these keeps getting repeated, could it be that the
index configuration fails, and retries the next time I make a query?
I am now using this code to configure;
NodeBuilder index = IndexUtils.getOrCreateOakIndex(builder);
index.child("lucene")
.setProperty("jcr:primaryType", "oak:QueryIndexDefinition", Type.NAME)
.setProperty("compatVersion", "2")
.setProperty("type", "lucene")
.setProperty("async", "async")
.setProperty("reindex", true)
.child("indexRules")
.setProperty(":childOrder", ImmutableSet.of("ka:asset"), Type.STRINGS)
.child("ka:asset")
.setProperty("jcr:primaryType", "nt:unstructured", Type.NAME)
.child("properties")
.setProperty("jcr:primaryType", "nt:unstructured", Type.NAME)
.setProperty(":childOrder",
ImmutableSet.of("allProps"), Type.STRINGS)
.child("allProps")
.setProperty("jcr:primaryType", "nt:unstructured",
Type.NAME)
.setProperty("name", ".*")
.setProperty("isRegExp", true)
.setProperty("nodeScopeIndex", true);
select * from [ka:asset] where lower(*) like '%admin%'
yields two entries
select * from [ka:asset] where contains(*,'admin')
yields none.
I am wondering if the setup of the repository is correct? I assume
that with the default LuceneIndexProvider() constructor, it will use
lucene indexes stored as segments in the segment store?
On 25 February 2015 at 10:46, Chetan Mehrotra <[email protected]> wrote:
> Hi Torgeir,
>
> By default the Lucene index would be updated every 5 sec. So are you
> performing query immediately after adding the content? If thats the
> case you can remove setting "async" property at least for your
> testcase to get Lucene index triggered immediately after commit
>
>> 21:58:51,075 WARN lucene.IndexDefinition.collectIndexRules() - line
> 505 [0:0:0:0:0:0:0:1] - IndexRule node does not have orderable
> children in [Lucene Index : genericlucene(/oak:index/lucene)]
> 21:58:51,076 WARN
>
> You can create the index definition via JCR API. Basically the
> orderable children are detected via presence of ':childOrder' hidden
> property. When you set a nodetype to nt:unstructured then oak-jcr
> would set this property automatically to record the ordering. However
> if you do it via NodeStore API then that has to be done manually.
>
> Chetan Mehrotra
--
-Tor