[MAGNOLIA-5301] JCR query result nodes have different order than in JCR tree Created: 06/Sep/13  Updated: 15/Jul/21  Resolved: 05/Dec/13

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 5.0
Fix Version/s: 5.1

Type: Bug Priority: Minor
Reporter: Cedric Reichenbach Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnolia 5 with workspaces using Jackrabbit 1.5+


Attachments: PNG File Screenshot 2020-10-31 at 11.51.22.png    
Issue Links:
duplicate
duplicates MAGNOLIA-5286 Switching respectDocumentOrder to fal... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

When firing a JCR query, the resulting node order does not reflect the order in their JCR tree (e.g. as displayed in a content app). The reason is that Jackrabbit's attribute "respectDocumentOrder" is false by default (version 1.5+) for performance.

Solution
In a workspace's workspace.xml inside the SearchIndex tag, add

<param name="respectDocumentOrder" value="true"/>


 Comments   
Comment by Jan Haderka [ 05/Dec/13 ]

This parameter was reverted back to old value in 5.1.
You can also do so in your workspace.xml in every workspace affected manually.

Comment by Will Scheidegger [ 31/Oct/20 ]

Are you sure that this is working properly? I'm on Magnolia 6.2 EE and the workspace.xml looks as follows:

 

 

<?xml version="1.0" encoding="UTF-8"?>
<Workspace name="pem-professionalsCategories">   
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${wsp.home}/default"/>
    </FileSystem>
    <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager">
        <param name="url" value="jdbc:h2:${wsp.home}/db;AUTO_SERVER=TRUE"/>
        <param name="schemaObjectPrefix" value="pm_${wsp.name}_"/>
    </PersistenceManager>
    <SearchIndex class="info.magnolia.jackrabbit.lucene.SearchIndex">
        ...              
        <param name="respectDocumentOrder" value="true"/>
    </SearchIndex>
</Workspace>

JCR-Tree looks like so:

 

X-Path query:

 

//element(*, pem:professionalsCategory)

Result:

3 nodes returned in 19ms
/ing
/inst
/partner

 

JCR-SQL2 query:

 

SELECT * FROM [pem:professionalsCategory]

 

Result:

 

3 nodes returned in 6ms
/inst
/partner
/ing

 

Comment by Ueli Scheidegger [ 30/Jun/21 ]

Tripping over this bug again. The mentioned "solution" does not work. Do you want me to create a new issue or can someone re-open this one? 

Comment by Mercedes Iruela [ 15/Jul/21 ]

We detected this issue also, you can find more information here and in MAGNOLIA-7802.

Comment by Ueli Scheidegger [ 15/Jul/21 ]

Now that's unfortunate.

Generated at Mon Feb 12 04:03:52 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.