Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

QueryBuilder - Search in multi path with multi properties

Jasmine_Liu
Level 2
Level 2

 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
smacdonald2008
Correct answer by
Level 10
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

0 Replies
Jasmine_Liu
Level 2
Level 2

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.

Jasmine_Liu
Level 2
Level 2

Thank you. But it doesn't help.

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

smacdonald2008
Level 10
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? 

Jasmine_Liu
Level 2
Level 2

Thank you very much. My CQ version is 5.6.1

smacdonald2008
Correct answer by
Level 10
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.