Hi,
when I execute the following query, having the previously mentioned index
(with a tag)
SELECT * FROM [nt:file] AS s WHERE s.[jcr:path] in ('/testVisor',
'carpeta1') ORDER BY [jcr:lastModified] ASC option(index tag [myTag])
I get the following plan:
query plan [nt:file] as [s] /* lucene:myIndex(/oak:index/ myIndex )
+(jcr:primaryType:Test1 jcr:primaryType:nt:file jcr:primaryType:EncFile
jcr:primaryType:Prueba jcr:primaryType:cmis:document jcr:primaryType:File
jcr:mixinTypes:Sec1 jcr:mixinTypes:PRueba) +(jcr:path:/testVisor
jcr:path:carpeta1) ordering:[{ propertyName : jcr:lastModified,
propertyType : UNDEFINED, order : ASCENDING }] where [s].[jcr:path]
in('/testVisor', 'carpeta1') */
it says in the ordering part: "propertyType : UNDEFINED", would it be
related to my first question about defining the type of the properties in
the index definition?
Jorge
El mar, 25 jun 2024 a las 16:43, Jorge Flórez (<[email protected]>)
escribió:
> Hi all,
> looking at some other problems in log using DEBUG level I found the
> following lines:
>
> DEBUG (async-index-update-async) [/oak:index/fileNodes] Ordered property
> defined with type STRING differs from property jcr:created =
> 2024-06-18T11:37:44.076-05:00 with type DATE in path /r10M6/pdfOCR4
>
> DEBUG (async-index-update-async) [/oak:index/fileNodes] Ordered property
> defined with type STRING differs from property jcr:lastModified =
> 2024-06-18T11:37:44.087-05:00 with type DATE in path /r10M6/pdfOCR4
>
> DEBUG (async-index-update-async) [/oak:index/fileNodes] Ordered property
> defined with type STRING differs from property jcr:primaryType = File with
> type NAME in path /r10M6/pdfOCR4
>
> my index looks like this:
> {
> "compatVersion": 2,
> "async": "async",
> "jcr:primaryType": "oak:QueryIndexDefinition",
> "evaluatePathRestrictions": true,
> "type": "lucene",
> "indexRules": {
> "jcr:primaryType": "nt:unstructured",
> "nt:file": {
> "jcr:primaryType": "nt:unstructured",
> "properties": {
> "jcr:primaryType": "nt:unstructured",
> "created": {
> "name": "jcr:created",
> "propertyIndex": true,
> "ordered": true,
> "jcr:primaryType": "nt:unstructured"
> },
> "lastModified": {
> "name": "jcr:lastModified",
> "propertyIndex": true,
> "ordered": true,
> "jcr:primaryType": "nt:unstructured"
> },
> "name": {
> "name": ":name",
> "propertyIndex": true,
> "ordered": true,
> "jcr:primaryType": "nt:unstructured",
> "type": "String"
> }
> }
> }
> }
> }
>
> Would it be better if I define the type for each property, instead of
> being "inferred
> <https://jackrabbit.apache.org/oak/docs/query/lucene.html#property-definitions>"?
> in my index should be DATE, DATE and STRING (or NAME) respectively?
>
> Thanks.
>
> Jorge
>