I have a custom code with a custom query that runs on publish event through a listener, the query doesnt returns correct results the first time it runs because the property that I indexed has not yet been indexed when the query was triggered, it is a race condition. I tried changing my asynchronous index to an asynchronous index and that fixed the problem in my local, however it seems synchronous indexes are not supported in AEMaaCS, see
Below was my original index and I removed async from it
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="oak:QueryIndexDefinition"
async="[async]"
compatVersion="{Long}2"
includedPaths="[/content/anf,/content/hco,/content/experience-fragments]"
queryPaths="[/content/path1,/content/path2,/content/experience-fragments]"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<nt:base jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<urlType jcr:primaryType="nt:unstructured"
name="myProperty"
propertyIndex="{Boolean}true"/>
</properties>
</nt:base>
</indexRules>
</jcr:root>
How do I fix this without using synchronous indexes?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @troubleshooter3
AEMaaCS doe snot support other index than Lucene, and Lucene does not support synchronous due to performance.
https://jackrabbit.apache.org/oak/docs/query/lucene.html#index-definition
Asynchronous Indexing
Views
Replies
Total Likes
Hi @troubleshooter3
AEMaaCS doe snot support other index than Lucene, and Lucene does not support synchronous due to performance.
https://jackrabbit.apache.org/oak/docs/query/lucene.html#index-definition
Asynchronous Indexing
Views
Replies
Total Likes
I agree, but what is a solution for my situation where I need to query as soon as publish event starts, how do I face this race condition?
Views
Replies
Total Likes
Hi @troubleshooter3
I think you can't in AEMaaCS, sync is not supported by Lucene index
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies
Views
Likes
Replies