mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged searchapi (5.2.1) to 5.2.N (5.2.1)
130061 gjames: SEARCH-120: Facet queries label support git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130300 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -203,6 +203,8 @@ public class SearchMapper
|
||||
{
|
||||
for (Template aTemplate:templates)
|
||||
{
|
||||
ParameterCheck.mandatoryString("template name", aTemplate.getName());
|
||||
ParameterCheck.mandatoryString("template template", aTemplate.getTemplate());
|
||||
sp.addQueryTemplate(aTemplate.getName(), aTemplate.getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -270,6 +272,7 @@ public class SearchMapper
|
||||
{
|
||||
for (FilterQuery fq:filterQueries)
|
||||
{
|
||||
ParameterCheck.mandatoryString("filterQueries query", fq.getQuery());
|
||||
sp.addFilterQuery(fq.getQuery());
|
||||
}
|
||||
}
|
||||
@@ -286,7 +289,17 @@ public class SearchMapper
|
||||
{
|
||||
for (FacetQuery fq:facetQueries)
|
||||
{
|
||||
sp.addFacetQuery(fq.getQuery());
|
||||
ParameterCheck.mandatoryString("facetQuery query", fq.getQuery());
|
||||
String query = fq.getQuery();
|
||||
String label = fq.getLabel()!=null?fq.getLabel():query;
|
||||
|
||||
if (query.startsWith("{!afts"))
|
||||
{
|
||||
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
|
||||
new Object[] { ": Facet queries should not start with !afts" });
|
||||
}
|
||||
query = "{!afts key='"+label+"'}"+query;
|
||||
sp.addFacetQuery(query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user