We have implemented custom search using query builder for Pages and Assets. When i set
p.excerpt = true, I get all the information of excerpt for both pages and assets (pdfs mainly) but query gets super slow.
The query works as excepted (faster) if I just set the excerpt for Pages but as soon as i use it for assets, it gets slow.
Is there any way to extract excerpt for huge volume of assets faster through querybuilder search.
(/jcr:root/content/xxx/us/en//element(*, cq:Page)[(jcr:contains(., 'xyz') and not(jcr:content/@isNotSearchable))] | /jcr:root/content/dam/xxx/documents//element(*, dam:Asset)[(jcr:contains(., 'xyz') )])/rep:excerpt(.)
Hi Shashi, it is aem 6.5.4
I am trying to highlight search results (full text search)
This is how i am fetching it in code (The query is mentioned in original post):
The code returns the excerpt as expected but the query gets super slow if i put p.excerpt = true for Assets
Thanks @Shashi_Mulugu. Yeah I tried that.
Here is my query performance when I include p.excerpt =true.
As you can see the query response time goes down to 59 ms from 5697 ms because of p.excerpt = true.
I could not find any helpful article/resource explaining tuning of query with excerpt.
The rest of the query is picking up the OOTB indexes to which we have added our custom property indexes for isNotSearchable. There is nothing else in the query. The query is pretty much restricted over the searchable content.
Thanks @Shashi_Mulugu . I want to use the useInExcerpt but all indexes for Dam are about the metadata properties. I am not sure if I put useInExcerpt = true on metadata properties , it will help in indexing the actual content of the pdf for useInExcerpt
Is there way I can use useInExcerpt on actual content of the pdfs so that the content of the pdf gets indexed and not the metadata properties?
Here are the dam indexes (all metadata)
Let me know. I appreciate your help