mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
ACS-5487 - Track Total Hits on ES (#2041)
SearchParameters - added trackTotalHits (int) attribute SearchRequest - Added trackTotalHitsLimit (int) to the Limits attribute and mapped it to the SearchParameters Changed the SearchRequest model in TAS to include a new RestRequestLimitsModel that has the new trackTotalHitsLimit attribute SearchMapperTests to test the changes in the SearchParameters
This commit is contained in:
@@ -201,6 +201,11 @@ public class SearchParameters implements BasicSearchParameters
|
||||
|
||||
private String timezone;
|
||||
|
||||
/**
|
||||
* Configure the limit to track the total hits on search results
|
||||
*/
|
||||
private int trackTotalHits;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
@@ -251,6 +256,7 @@ public class SearchParameters implements BasicSearchParameters
|
||||
sp.stats = this.stats;
|
||||
sp.ranges = this.ranges;
|
||||
sp.timezone = this.timezone;
|
||||
sp.trackTotalHits = this.trackTotalHits;
|
||||
return sp;
|
||||
}
|
||||
|
||||
@@ -1641,6 +1647,21 @@ public class SearchParameters implements BasicSearchParameters
|
||||
{
|
||||
this.includeMetadata = includeMetadata;
|
||||
}
|
||||
|
||||
|
||||
public int getTrackTotalHits()
|
||||
{
|
||||
return trackTotalHits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a maximum value for the report of total hits. The reported number of hits will never exceed this limit even
|
||||
* if more are found. If unset, the engine’s default tracking limit is applied. To remove any limit, set to -1.
|
||||
*
|
||||
* @param trackTotalHits int
|
||||
*/
|
||||
public void setTrackTotalHits(int trackTotalHits)
|
||||
{
|
||||
this.trackTotalHits = trackTotalHits;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user