Merged searchbcr (5.2.1) to 5.2.N (5.2.1)

136069 gjames: SEARCH-334: Moved generic facet classes to repo so they can be used by SolrJSONResultSet


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@136099 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2017-03-24 13:18:12 +00:00
parent 4764a458a3
commit d10af226d5
4 changed files with 0 additions and 224 deletions

View File

@@ -1,69 +0,0 @@
/*-
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2017 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.api.search.context.facetsresponse;
import java.util.List;
/**
* A Generic Bucket response covering range, interval, pivot etc.
*/
public class GenericBucket
{
private final String label;
private final String filterQuery;
private final Object display;
private final List<Metric> metrics;
public GenericBucket(String label, String filterQuery, Object display, List<Metric> metrics)
{
this.label = label;
this.filterQuery = filterQuery;
this.display = display;
this.metrics = metrics;
}
public String getFilterQuery()
{
return filterQuery;
}
public Object getDisplay()
{
return display;
}
public String getLabel()
{
return label;
}
public List<Metric> getMetrics()
{
return metrics;
}
}

View File

@@ -1,62 +0,0 @@
/*-
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2017 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.api.search.context.facetsresponse;
import java.util.List;
/**
* A Generic facet response covering range, interval, pivot etc.
*/
public class GenericFacetResponse
{
public static enum FACET_TYPE {range, interval};
private final FACET_TYPE type;
private final String label;
private final List<GenericBucket> buckets;
public GenericFacetResponse(FACET_TYPE type, String label, List<GenericBucket> buckets)
{
this.type = type;
this.label = label;
this.buckets = buckets;
}
public String getLabel()
{
return label;
}
public List<GenericBucket> getBuckets()
{
return buckets;
}
public FACET_TYPE getType()
{
return type;
}
}

View File

@@ -1,39 +0,0 @@
/*-
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2017 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.api.search.context.facetsresponse;
import java.util.Map;
import java.util.Date;
/**
* Metrics returned from Solr
*/
public interface Metric
{
public static enum METRIC_TYPE {count};
METRIC_TYPE getType();
Map<String, Object> getValue();
}

View File

@@ -1,54 +0,0 @@
/*-
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2017 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.api.search.context.facetsresponse;
import java.util.HashMap;
import java.util.Map;
/**
* A count metric
*/
public class MetricCount implements Metric
{
private final Map<String, Object> value = new HashMap<>(1);
public MetricCount(Integer count)
{
value.put("count", count);
}
@Override
public METRIC_TYPE getType()
{
return METRIC_TYPE.count;
}
@Override
public Map<String, Object> getValue()
{
return value;
}
}