What is the use of facets property in lucene oak index? | Community
Skip to main content
Adobe Champion
February 22, 2022
Solved

What is the use of facets property in lucene oak index?

  • February 22, 2022
  • 2 replies
  • 2839 views

I have a custom Lucene index created for my project with all the required properties. This is an assets implementation project and hence the search filters are used to search assets.

This search is OOB, with custom properties added in search facets. This search is not working because of node traversal issues. The page will just show the loading icon, if we search something in the custom properties. These properties which is being searched are already indexed in the custom index and the query is picking the correct custom index as well.

Can someone help me with any property specific to use for search filters/ facets search optimization? Is the facets node and property used for this purpose? Appreciate if someone can shed some lights.

Attaching the explain query results from query performance tool here.

Query causing issue: /jcr:root/content/dam//element(*, dam:Asset)[((fn:lower-case(jcr:content/metadata/@lcl:articleId)='20014477'))]/(rep:facet(jcr:content/metadata/dc:format)|rep:facet(jcr:content/metadata/dam:status))

 

Index definition created: 

 

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

Can you try to remove the "fn:lowercase" function from your query? That should help to avoid traversals without the need to further adjust your index definitions.

2 replies

joerghoh
Adobe Employee
Adobe Employee
February 23, 2022

Can you show the query which is executed and then also the index definitions you created/customized?

P_V_NairAdobe ChampionAuthor
Adobe Champion
February 23, 2022

@joerghoh Updated the description with all the required data you requested for.

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
February 25, 2022

Can you try to remove the "fn:lowercase" function from your query? That should help to avoid traversals without the need to further adjust your index definitions.

P_V_NairAdobe ChampionAuthor
Adobe Champion
February 25, 2022

@joerghoh  Thanks a lot for your suggestion. I removed the ignorecase for the property from the search facets form and that fixed my issue.

joerghoh
Adobe Employee
Adobe Employee
February 25, 2022

If just compare digits, ignoring the case is not necessary.

 

But if you also compare characters and you cannot guarantee, that all input is lower-cased already, you would need to adjust your index definition for this property and add a

function=fn:lower-case(@lcl:articleId)

to it. This would apply the lowercase function already at indexing time, so you store only lower-case characters within the index.

 

(The JCR Query Sheet cheat covers this case: https://experienceleague.adobe.com/docs/experience-manager-65/assets/JCR_query_cheatsheet-v1.0.pdf?lang=en)