Expand my Community achievements bar.

SOLVED

How can I solve this bug when searching for a content fragment in a specific path?

Avatar

Level 3

Hello, my question is simple, but I want to understand why this query returns content fragments from other folders even though I specified the "riosp" folder? The "group.2" returns only the fragments inside the "riosp" folder correctly, but the "group.1" returns fragments from other folders.

My folders
/content/dam/conteúdo-multicanal/rodovias/conteudo/taxas-de-pedagio/riosp
/content/dam/conteúdo-multicanal/rodovias/conteudo/taxas-de-pedagio/autoban
/content/dam/conteúdo-multicanal/rodovias/conteudo/taxas-de-pedagio/msvia


My code

Map<String, String> queryParameterMap = new HashMap<>();
queryParameterMap.put("type", NT_DAM_ASSET);
queryParameterMap.put("p.limit", Integer.toString(maxItems));

queryParameterMap.put("group.p.or", "true");
queryParameterMap.put("group.1_property", JcrConstants.JCR_CONTENT + "/data/cq:model");
queryParameterMap.put("group.1_property.value", "/conf/myproject/settings/dam/cfm/models/veiculos-com-multiplicadores");
queryParameterMap.put("group.1_path", "/content/dam/conteúdo-multicanal/rodovias/conteudo/taxas-de-pedagio/riosp");
 
queryParameterMap.put("group.2_property", JcrConstants.JCR_CONTENT + "/data/cq:model");
queryParameterMap.put("group.2_property.value", "/conf/myproject/settings/dam/cfm/models/ponto-de-parada");
queryParameterMap.put("group.2_path", "/content/dam/conteúdo-multicanal/rodovias/conteudo/ponto-de-parada/riosp");
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @NathanVieira , Updating your queryParameterMap to below should solve the issue. Please try this.

 

queryParameterMap.put("group.p.or", "true");
queryParameterMap.put("group.1_group.property", JcrConstants.JCR_CONTENT + "/data/cq:model");
queryParameterMap.put("group.1_group.property.value", "/conf/myproject/settings/dam/cfm/models/veiculos-com-multiplicadores");
queryParameterMap.put("group.1_group.path", "/content/dam/conteúdo-multicanal/rodovias/conteudo/taxas-de-pedagio/riosp");

queryParameterMap.put("group.2_group.property", JcrConstants.JCR_CONTENT + "/data/cq:model");
queryParameterMap.put("group.2_group.property.value", "/conf/myproject/settings/dam/cfm/models/ponto-de-parada");
queryParameterMap.put("group.2_group.path", "/content/dam/conteúdo-multicanal/rodovias/conteudo/ponto-de-parada/riosp");

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @NathanVieira , Updating your queryParameterMap to below should solve the issue. Please try this.

 

queryParameterMap.put("group.p.or", "true");
queryParameterMap.put("group.1_group.property", JcrConstants.JCR_CONTENT + "/data/cq:model");
queryParameterMap.put("group.1_group.property.value", "/conf/myproject/settings/dam/cfm/models/veiculos-com-multiplicadores");
queryParameterMap.put("group.1_group.path", "/content/dam/conteúdo-multicanal/rodovias/conteudo/taxas-de-pedagio/riosp");

queryParameterMap.put("group.2_group.property", JcrConstants.JCR_CONTENT + "/data/cq:model");
queryParameterMap.put("group.2_group.property.value", "/conf/myproject/settings/dam/cfm/models/ponto-de-parada");
queryParameterMap.put("group.2_group.path", "/content/dam/conteúdo-multicanal/rodovias/conteudo/ponto-de-parada/riosp");