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)
130027 gjames: SEARCH-120: Implementing facet queries git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130288 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,16 +25,28 @@
|
||||
*/
|
||||
package org.alfresco.rest.framework.resource.parameters;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The contextual results of a Search
|
||||
*/
|
||||
public class SearchContext
|
||||
{
|
||||
Consistency consistency;
|
||||
private final Consistency consistency;
|
||||
private final List<FacetQueryResult> facetQueries;
|
||||
|
||||
public SearchContext(long lastTxId)
|
||||
public SearchContext(long lastTxId, List<FacetQueryResult> facetQueries)
|
||||
{
|
||||
consistency = new Consistency(lastTxId);
|
||||
if (lastTxId > 0)
|
||||
{
|
||||
consistency = new Consistency(lastTxId);
|
||||
}
|
||||
else
|
||||
{
|
||||
consistency = null;
|
||||
}
|
||||
this.facetQueries = facetQueries;
|
||||
}
|
||||
|
||||
public Consistency getConsistency()
|
||||
@@ -42,9 +54,36 @@ public class SearchContext
|
||||
return consistency;
|
||||
}
|
||||
|
||||
public List<FacetQueryResult> getFacetQueries()
|
||||
{
|
||||
return facetQueries;
|
||||
}
|
||||
|
||||
public static class FacetQueryResult
|
||||
{
|
||||
private final String label;
|
||||
private final int count;
|
||||
|
||||
public FacetQueryResult(String label, int count)
|
||||
{
|
||||
this.label = label;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
public int getCount()
|
||||
{
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
public class Consistency
|
||||
{
|
||||
private long lastTxId;
|
||||
private final long lastTxId;
|
||||
|
||||
public Consistency(long lastTxId)
|
||||
{
|
||||
|
Reference in New Issue
Block a user