I see my index is being scheduled to be updated;

18:44:12.642 INFO
.o.p.i.l.LuceneIndexEditorContext.createIndexDefinition(265) Refreshed the
index definition for [/oak:index/lowercase]
18:44:12.643 DEBUG
.o.p.i.l.LuceneIndexEditorContext.createIndexDefinition(267) Updated index
definition is   /{compatVersion = 2, async = async, reindex = true, refresh
= true, jcr:primaryType = oak:QueryIndexDefinition, type = lucene}
    indexRules{jcr:primaryType = nt:unstructured, :childOrder = [ka:asset]}
      ka:asset{jcr:primaryType = nt:unstructured, :childOrder =
[properties]}
        properties{jcr:primaryType = nt:unstructured, :childOrder =
[lowercase]}
          lowercase{jcr:primaryType = nt:unstructured, function =
lower([title])}
          title{jcr:primaryType = nt:unstructured, function =
lower([title])}
18:44:12.647 INFO  o.a.j.o.p.i.IndexUpdate.enter(167)
     Reindexing will be performed for following indexes:
[/oak:index/lowercase]
18:44:12.653 INFO  o.a.j.o.p.i.IndexUpdate.reindexingTraversalStart(74)
     Estimated node count to be traversed for reindexing under / is [459776]
18:44:12.741 DEBUG o.a.j.o.p.i.AsyncIndexUpdate.cleanUpCheckpoints(654)
     [async] Cleaning up orphaned checkpoints

But when I try to do a query, it seems the lowercase function index is
ignored;

19:50:42.838 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost using filter Filter(query=select * from [ka:asset] where
lower([title]) = 'tor', path=*, property=[function*lower*@title=[tor],
title=[is not null]])
19:50:42.839 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for reference is Infinity
19:50:42.840 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for property is 22402.0
19:50:42.840 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for nodeType is 49604.0
19:50:42.841 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for [/oak:index/lowercase] of type (lucene-property) with plan
[lucene:lowercase(/oak:index/lowercase) function*lower*@title:tor] is
54080.00
19:50:42.842 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for lucene-property[/oak:index/lowercase] is 54080.0
19:50:42.843 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for aggregate lucene-property is Infinity
19:50:42.843 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for aggregate lucene is Infinity
19:50:42.844 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for aggregate aggregate lucene is Infinity
19:50:42.844 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     cost for traverse is 459876.0
19:50:42.845 TRACE o.a.j.o.q.QueryEngineImpl.prepareAndSelect(305)
    No alternatives found. Query: select [ka:asset].[ka:assetType] as
[ka:asset.ka:assetType], [ka:asset].[jcr:uuid] as [ka:asset.jcr:uuid] from
[ka:asset] as [ka:asset] where lower([ka:asset].[title]) = 'tor'
19:50:42.845 TRACE o.a.j.o.q.s.QueryRecorder.record(67)
     query: select * from [ka:asset] where lower([title]) = 'tor'
19:50:42.845 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     query execute select * from [ka:asset] where lower([title]) = 'tor'
19:50:42.846 DEBUG o.a.j.o.q.QueryImpl.logDebug(1168)
     query plan [ka:asset] as [ka:asset] /* property title IS NOT NULL
where lower([ka:asset].[title]) = 'tor' */
19:50:42.971 WARN
s.ContentMirrorStoreStrategy.fetchNextPossiblyDuplicate(460)
Index-Traversed 10000 nodes (26049 index entries) using index title with
filter Filter(query=select * from [ka:asset] where lower([title]) = 'tor',
path=*, property=[function*lower*@title=[tor], title=[is not null]])
19:50:43.119 WARN
s.ContentMirrorStoreStrategy.fetchNextPossiblyDuplicate(460)
Index-Traversed 20000 nodes (48960 index entries) using index title with
filter Filter(query=select * from [ka:asset] where lower([title]) = 'tor',
path=*, property=[function*lower*@title=[tor], title=[is not null]])


On Wed, 5 Sep 2018 at 00:55, Torgeir Veimo <[email protected]> wrote:

> I'm trying to debug why my lower([property]) index is not working, and was
> looking for some official documentation for OAK-3574. Is there any
> available except for what's in the jira issue at
> https://issues.apache.org/jira/browse/OAK-3574 ?
>
> I was wondering if there was a convenience method to create such indexes
> similar to how one can use
> LuceneIndexHelper.newLucenePropertyIndexDefinition()
>
>
> -Tor
>


-- 
-Tor

Reply via email to