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

Need help on search querying both pages and assets and if assets then search their title etc

Ravi_KS
Level 3
Level 3

Dear All,

I am facing a strange issue. I am using querybuilder api to search in our website. Requirement is to search both page and assets on a specific paths and if its asset then look for specific types only like PDF or word etc and look for the search term in title or description.

I have build the query properly and the predicates looks like below,

fulltext=Ravi
mainasset=true
1_group.1_group.path=/content/<folder>
1_group.2_group.path=/content/dam/<folder>
1_group.p.or=true


2_group.1_group.type=cq:Page
2_group.2_group.type=dam:Asset
2_group.p.or=true

2_group.2_group.1_property=jcr:content/metadata/dc:format
2_group.2_group.1_property.1_value=application/vnd.ms-excel
2_group.2_group.1_property.2_value=application/pdf
2_group.2_group.1_property.3_value=application/vnd.ms-word
2_group.2_group.1_property.4_value=application/msword
2_group.2_group.1_property.5_value=application/vnd.openxmlformats-officedocument.wordprocessingml.document

2_group.2_group.5_group.2_property.operation=like
2_group.2_group.5_group.2_property=jcr:content/metadata/dc:description
2_group.2_group.5_group.2_property.1_value=%Ravi%
2_group.2_group.5_group.3_property.operation=like
2_group.2_group.5_group.3_property=jcr:content/metadata/cq:tags
2_group.2_group.5_group.3_property.1_value=%Ravi%
2_group.2_group.5_group.4_property.operation=like
2_group.2_group.5_group.4_property=jcr:content/metadata/dc:title
2_group.2_group.5_group.4_property.1_value=%Ravi%
2_group.2_group.5_group.p.or=true

orderby.sort=desc
p.offset=0
p.limit=10
p.hits=selective

This query works fine in my local instance however the same query does not work in our other environments. If I remove the block 

2_group.1_group.type=cq:Page
2_group.2_group.type=dam:Asset
2_group.p.or=true 

and just put type=dam:Asset  the query fetches the document, when I OR it with page it does not work. Do anyone have any idea on this? Please help.

4 Replies
kautuk_sahni
Community Manager
Community Manager

Hi 

Moving this thread to AEM "Asstes" topic so to have better contextual experts have a look at this.

~kautuk

Ashwin_Raju
Level 3
Level 3

Hi,

Is the server using mongo db ? Since the query works on local which I assume is TarMK and is not working in other environments.

Regards,

Ashwin Raju

Ravi_KS
Level 3
Level 3

Hi Ashwin,

Its same on all environments - TarMk. We are no using MongoDB