mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Search-347, added a method to check if faceting is used
This commit is contained in:
@@ -1081,6 +1081,36 @@ public class SearchParameters implements BasicSearchParameters
|
|||||||
return this.spellCheck;
|
return this.spellCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if faceting is used as part of the query, Search-347.
|
||||||
|
* @param searchParameters
|
||||||
|
* @return true if exists
|
||||||
|
*/
|
||||||
|
public boolean hasFaceting(SearchParameters searchParameters)
|
||||||
|
{
|
||||||
|
if(facetQueries != null && !facetQueries.isEmpty())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(fieldFacets != null && !fieldFacets.isEmpty())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(interval != null && !interval.getIntervals().isEmpty() || !interval.getSets().isEmpty())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(pivots != null && !pivots.isEmpty())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(range != null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param spellCheck the spellCheck to set
|
* @param spellCheck the spellCheck to set
|
||||||
*/
|
*/
|
||||||
@@ -1128,6 +1158,7 @@ public class SearchParameters implements BasicSearchParameters
|
|||||||
result = prime * result + ((facetQueries.isEmpty()) ? 0 : facetQueries.hashCode());
|
result = prime * result + ((facetQueries.isEmpty()) ? 0 : facetQueries.hashCode());
|
||||||
result = prime * result + ((filterQueries.isEmpty()) ? 0 : filterQueries.hashCode());
|
result = prime * result + ((filterQueries.isEmpty()) ? 0 : filterQueries.hashCode());
|
||||||
result = prime * result + ((pivots.isEmpty()) ? 0 : pivots.hashCode());
|
result = prime * result + ((pivots.isEmpty()) ? 0 : pivots.hashCode());
|
||||||
|
result = prime * result + ((range == null) ? 0 : range.hashCode());
|
||||||
result = prime * result + ((searchTerm == null) ? 0 : searchTerm.hashCode());
|
result = prime * result + ((searchTerm == null) ? 0 : searchTerm.hashCode());
|
||||||
result = prime * result + (spellCheck ? 1231 : 1237);
|
result = prime * result + (spellCheck ? 1231 : 1237);
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user