Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

QueryBuilder - Search in multi path with multi properties

Avatar

Former Community Member

 Hi,

I'm building a query to search result in multiple path with multiple properties. 

fulltext=test
group.p.or=true
group.1_group.path=/content/myproject
group.1_group.type=cq:Page
group.2_group.path=/content/dam/myprject
group.2_group.type=dam:Asset

daterange.p.or=true
daterange.1_property=jcr:content/jcr:created
daterange.2_property=jcr:content/jcr:lastModified
daterange.upperBound=2014-01-20T11:56:04.546+08:00

I want to search items in 2 path and have same date range on different properties.

With above query, i got below error message:

Internal Server Error

Cannot serve request to /WC2/bin/querybuilder.json in com.day.cq.search.impl.servlets.QueryBuilderJsonServlet

Exception:

java.lang.NullPointerException at com.day.cq.search.eval.XPath.getPropertyPath(XPath.java:57) at com.day.cq.search.eval.RangePropertyPredicateEvaluator.getXPathExpression(RangePropertyPredicateEvaluator.java:97) at com.day.cq.search.eval.DateRangePredicateEvaluator.getXPathExpression(DateRangePredicateEvaluator.java:68) at com.day.cq.search.eval.PredicateGroupEvaluator.getXPathExpression(PredicateGroupEvaluator.java:73) at com.day.cq.search.impl.builder.RootEvaluator.getXPathExpression(RootEvaluator.java:198) at com.day.cq.search.impl.builder.QueryImpl.execute(QueryImpl.java:373) at com.day.cq.search.impl.builder.QueryImpl.getResult(QueryImpl.java:108)

 

And i also tried below query, and the search result is not correct with 'NO FILTERING SUPPORT' error.

fulltext=test
group.p.or=true
group.1_group.path=/content/myproject
group.1_group.type=cq:Page
group.2_group.path=/content/dam/myproject
group.2_group.type=dam:Asset

group.1_group.property.and=true
group.1_group.1_property=jcr:content/jcr:createdBy
group.1_group.1_property.value=admin
group.1_group.daterange.property=jcr:content/date
group.1_group.daterange.upperBound=2014-01-20T11:56:04.546+08:00

 

 

 

Could anyone suggest?

Thanks,
Jasmine

1 Accepted Solution

Avatar

Correct answer by
Level 10

I have not forgotten this thread I have successfully got my CQ Query Builder App up and running:

[img]appgrid.png[/img]

For anyone reading this thread and want to know about Query Builder API using the Java API, see this community article:

http://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html

I will extend this example to search multiple paths and see what happens. I will update this thread with the results. 

View solution in original post

6 Replies

Avatar

Level 10

We have examples of multipath searches in the AEM docs. See this topic:

http://dev.day.com/docs/en/cq/current/dam/customizing_and_extendingcq5dam/query_builder.html

Hope this topic helps. 

Avatar

Former Community Member

I have another question about multiple path search.

When I run below query, CQ server is keeping in full load, this is because I don't set 'fulltext'.

group.p.or=true
group.1_group.path=/content/myproject
group.1_group.type=cq:Page
group.2_group.path=/content/dam/myproject
group.2_group.type=dam:Asset

If I put 'fulltext=*', it will take more than 1 min to search the result.

What I want is to get all pages/files from /content/myproject and /content/dam/myproject. But seems it doesn't work without fulltext property.

Any idea about this?

 

And is it possible to combine 2 query results and sort again? Query of searching in multiple path is very slow.

Avatar

Former Community Member

Thank you. But it doesn't help.

I follow the document  but still get the error. Similar issue also asked in the comments below.

Avatar

Level 10

Looks like there is something not set properly. I will dig into this query and see if i can reduplicate it, What version of CQ are you using? 

Avatar

Former Community Member

Thank you very much. My CQ version is 5.6.1

Avatar

Correct answer by
Level 10

I have not forgotten this thread I have successfully got my CQ Query Builder App up and running:

[img]appgrid.png[/img]

For anyone reading this thread and want to know about Query Builder API using the Java API, see this community article:

http://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html

I will extend this example to search multiple paths and see what happens. I will update this thread with the results.