Lucene Index with Multiple Properties | Community
Skip to main content
AEM_Dan
Level 3
March 3, 2022
Solved

Lucene Index with Multiple Properties

  • March 3, 2022
  • 2 replies
  • 2583 views

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.
Best answer by joerghoh

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

2 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
March 4, 2022

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

AEM_Dan
AEM_DanAuthor
Level 3
March 14, 2022

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?

DEBAL_DAS
March 4, 2022

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.

 

 

 

 

 

 

 

joerghoh
Adobe Employee
Adobe Employee
March 4, 2022

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

DEBAL_DAS
March 4, 2022

Understood. Something like -