how to find the title which is repeated among two different content path using querybuilder in aem 6.5.
i need this result as com.day.cq.search.result.SearchResult result. i am using this result object for pagination, total cound , exeution time in search results.
i have tried with below approach
- i have using the below constrainsts and getting the results then assign to one list and finding the repeated title then using result list. but while doing pagination and total count its giving worng data.
Thanks, Vaibhavi, Actually I have written the utility to remove the duplicates and setting the node property. So after that, I have matching the predicates in our application to fetch the records in a search. it gives somehow better performance, and without affecting the pagination logic.
@nareshkumarpart Can you please share some more details about this utility for posterity?
In below query offset and plimit value is statically set. So during pagination you are not receiving the proper count.
Please update the offset and plimit value dynamically. Example:From above query,in first iteration you have received the results from 0(offset is set to 0)to 10(plimit is set for 10 records). In second iteration you should fetch next 10 result, so your offset should be updated to 10 and plimit as 20.
This should fix your issue.
Below summarizing for better understanding:
p.offsetdefines start of index means from which index you want to fetch records from query result.
p.limitdefines how many records you want to fetch.
Each query result will display results fromp.offset to p.offset + p.limit.