I'm working on implementing a search method in Java that needs to support several variations of search criteria. Specifically, I need the method to be able to:
Search by a term within certain fields, conditionally filter the data by a date range, limit the output to only include specified fields, and sort the results by one or more fields.
Perform the same operations as above but use a filterMap for filtering instead of a search term.
Combine both term-based and filterMap-based filtering.
Here's the signature of the method I've come up with: private List<Map<String, Object>> search( final Set<String> requestedFields, final List<SortBy> sortByList, final List<String> termSearchableFields, final String searchTerm, final Map<String, Object> filterMap, final DateRangeTerm dateRangeTerm )...