Lucene Index with Multiple Properties | Community
Skip to main content
AEM_Dan
Level 3
Mar 3, 2022 5:49 PM UTC
Solved

Lucene Index with Multiple Properties

I need to create a search index to address the traversing errors in error.log. Specifically:
.../* xpath: /jcr:root/content/solutions//*[(jcr:content/@page-category = 'category:news')] */, path=/content/solutions//*, property=[jcr:content/page-category=[category:news]]); consider creating an index or changing the query
.../* xpath: /jcr:root/content/solutions/en/stories//*[(jcr:content/@author = '/content/solutions/en/author/dan')] */, path=/content/solutions/en/stories//*, property=[jcr:content/author=[/content/solutions/en/author/dan]]); consider creating an index or changing the query
.../* xpath: /jcr:root/content/solutions//*[(jcr:content/@series = 'Press Releases')] */, path=/content/solutions//*, property=[jcr:content/series=[Press Releases]]); consider creating an index or changing the query

So it appears I need a property index for page-category, author, and series.

Explain Query tells me the Lucene index is more performant than a standard property index. So if I used Lucene, should it be 1 index with all 3 properties or 3 separate indexes?

 

There are many out-of-the-box Lucene property indexes. But I'm not sure if they are created that way to logically separate the properties or if it serves a purpose to have them separated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Employee
Mar 4, 2022 9:49 AM UTC

Hi,

 

yes, you can create a custom index, which contains these 3 properties.If you just do equality matches (as shown above), you don't need more settings in the index.

if you want to do work more sophisticated (e.g.  fulltext conditions) I recommend you to check the JCR Query Cheatsheet for AEM [1].

 

 

[1]: https://experienceleague.adobe.com/docs/experience-manager-65/assets/JCR_query_cheatsheet-v1.0.pdf?lang=en

10 replies

DEBAL_DAS
New Participant
Mar 4, 2022 11:16 AM UTC

I have executed below three xpath queries using Oak Index definition generator to understand few things like type lucene, property index will be true or not as shown below -

 

From these structure I have understood we could create index with all 3 properties then it will help you -

 

 

@joerghoh , please correct me also.

 

 

 

 

 

 

 

Translate
joerghoh
Employee
Mar 4, 2022 11:30 AM UTC

Yes, you can merge all of these 3 indexes into a single index.

Translate
DEBAL_DAS
New Participant
Mar 4, 2022 11:56 AM UTC

Understood. Something like -

 

 

Translate
joerghoh
joerghohAccepted solution
Employee
Mar 4, 2022 9:49 AM UTC

Hi,

 

yes, you can create a custom index, which contains these 3 properties.If you just do equality matches (as shown above), you don't need more settings in the index.

if you want to do work more sophisticated (e.g.  fulltext conditions) I recommend you to check the JCR Query Cheatsheet for AEM [1].

 

 

[1]: https://experienceleague.adobe.com/docs/experience-manager-65/assets/JCR_query_cheatsheet-v1.0.pdf?lang=en

Translate
AEM_Dan
AEM_DanAuthor
Level 3
Mar 14, 2022 5:37 PM UTC

So I had opened a support ticket prior to this post and didn't get a satisfactory answer, which is why I posted here.  However, eventually I got this response:

 

"If you have one index for all properties it will index all nodes that contain one of the properties, which can make the query less efficient. It is only recommended to use a single index when all of the properties being indexed are related to allow Lucene to evaluate as many property restrictions as possible natively."

 

What do you think?

Translate