Seeing intemittent issue for one of the newly created custom index in local | Community
Skip to main content
Level 3
January 23, 2024

Seeing intemittent issue for one of the newly created custom index in local

  • January 23, 2024
  • 3 replies
  • 1154 views

Hi

we see few warnings in logs for queries so I have created custom index for those and it's working fine. Only for one index I am seeing intermittent issue.

when I tried to do query performance with below query index name is not showing sometimes if I do reindex sometimes it is showing and sometimes it is not showing.

can we create index without index rules ?

I have tried to create in the below case but afterd deployment apps packageis not installed so I have added like below.

Can we create empty index rules for index with out property ?

Generally in which case we will add reidex to true ?

 

select [jcr:path], [jcr:score], * from [sling:Message] as a where isdescendantnode(a, '/apps/test/i18n/page/en')

 

compatVersion = 2
- async = "async"
- queryPaths = [/apps/test/i18n/page/en]
- includedPaths = [/apps/test/i18n/page/en]
- jcr:primaryType = oak:QueryIndexDefinition
- evaluatePathRestrictions = true
- type = "lucene"
+ indexRules
+ sling:Message
+ properties
+ SHOULD_ADD_PROPERTY_CONSTRAINT
- name = "SHOULD_ADD_PROPERTY_CONSTRAINT"

<i18Index
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="2"
evaluatePathRestrictions="{Boolean}true"
includedPaths="[/apps/test/i18n]"
queryPaths="[/apps/test/i18n]"
reindex="{Boolean}false"
reindexCount="{Long}1"
seed="{Long}8698841245336077431"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
</indexRules>
</i18Index>

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

TarunKumar
Community Advisor
Community Advisor
January 23, 2024

Hi @vijitha ,

When you set the "reindex" true does it automatically change to true after indexing. Once manual reindexing is done reindexCount should increase.
If that is not happening then there is something wrong in your query or local environment. Please check it in any other environment or fresh AEM instance.


Thanks
Tarun

vijithaAuthor
Level 3
January 23, 2024

Hi @tarunkumar 

Ya after reindexing I see count is getting increased. 

 

Raja_Reddy
Community Advisor
Community Advisor
January 23, 2024

Hi @vijitha 

  1. Can we create an index without index rules? 
    Yes, it is possible to create an index without index rules. However, index rules are typically used to define the properties and constraints for the index, so it is recommended to include them for better query performance.

  2. Can we create empty index rules for an index without properties? 
    Yes, you can create empty index rules for an index without properties. However, keep in mind that without any properties defined in the index rules, the index may not be useful for querying.

  3. In which case do we add reindex to true? The reindex property is used to indicate whether the index should be reindexed. Setting it to true means that the index will be rebuilt from scratch. You would typically set reindex to true when you want to rebuild the index due to changes in the data or index configuration.

vijithaAuthor
Level 3
January 23, 2024

Hi @raja_reddy 

Thank you for your response. I have created custom index for below query and when I tried to execute query in queryperformance tool index name is not showing. Please correct me if I am wrong.

select [jcr:path], [jcr:score], * from [sling:Message] as a where isdescendantnode(a, '/apps/test/i18n/page/en')

 

compatVersion = 2
- async = "async"
- queryPaths = [/apps/test/i18n/page/en]
- includedPaths = [/apps/test/i18n/page/en]
- jcr:primaryType = oak:QueryIndexDefinition
- evaluatePathRestrictions = true
- type = "lucene"
+ indexRules
+ sling:Message
+ properties
+ SHOULD_ADD_PROPERTY_CONSTRAINT
- name = "SHOULD_ADD_PROPERTY_CONSTRAINT"

 

<i18nIndex
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="2"
evaluatePathRestrictions="{Boolean}true"
includedPaths="[/apps/test/i18n]"
queryPaths="[/apps/test/i18n]"
reindex="{Boolean}false"
reindexCount="{Long}1"
seed="{Long}8687641045336066432"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<sling:Message jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<SHOULD_ADD_PROPERTY_CONSTRAINT
jcr:primaryType="nt:unstructured"
name="SHOULD_ADD_PROPERTY_CONSTRAINT"
propertyIndex="true"/>
</properties>
</sling:Message>
</indexRules>
</i18nIndex>

 

 

kautuk_sahni
Community Manager
Community Manager
January 30, 2024

@vijitha Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni