mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
||||
}
|
@@ -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();
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user