@Component(value="searchUtils") public class SearchUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SearchUtils.Month
Enum for months lookup
|
| Modifier and Type | Field and Description |
|---|---|
protected static List<String> |
defaultParams |
protected String |
nameIndexLocation |
protected boolean |
taxonProfileEnabled |
| Constructor and Description |
|---|
SearchUtils() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Facet> |
addFacetMap(String[] filterQuery,
Set<String> authIndexFields)
Create a HashMap for the filter queries, using the first SOLR field as the key and subsequent
query string as the value.
|
String |
convertRankAndName(String query)
Extracts the a rank and name from a query.
|
static String |
formatDynamicFieldName(String fieldName) |
static String |
formatGuid(String guid) |
static String |
formatSearchQuery(String query)
Formats the query string before
|
static Map<String,String[]> |
getExtraParams(Map map) |
List<String> |
getNextRanks(String rank,
boolean includeSuppliedRank)
Returns an ordered list of the next ranks after the supplied rank.
|
List<String> |
getRanks() |
List<OccurrenceSourceDTO> |
getSourceInformation(Map<String,Integer> sources)
Returns the information for the supplied source keys
TODO: There may be a better location for this method.
|
String[] |
getTaxonSearch(String lsid)
Returns an array where the first value is the search string and the
second is a display string.
|
String |
getUidDisplayString(String fieldName,
String uid) |
String |
getUidDisplayString(String fieldName,
String uid,
boolean includeField)
Returns the display string for the supplied uid
|
String |
getUidSearchField(String uid)
returns the solr field that should be used to search for a particular uid
|
String |
getUIDSearchString(String[] uids) |
static void |
setDefaultParams(SearchRequestParams requestParams)
Provide default values for parameters if they have any null or "empty" values
|
static String |
stripEscapedQuotes(String uid) |
boolean |
updateCollectionSearchString(SearchRequestParams searchParams,
String uid)
Returns an array that contains the search string to use for a collection
search and display name for the results.
|
protected String nameIndexLocation
protected boolean taxonProfileEnabled
public boolean updateCollectionSearchString(SearchRequestParams searchParams, String uid)
public String getUidDisplayString(String fieldName, String uid, boolean includeField)
uid - public String convertRankAndName(String query)
new String[]{"genus", "Macropus"};
query - public String[] getTaxonSearch(String lsid)
lsid - public static String formatSearchQuery(String query)
query - public String getUidSearchField(String uid)
uid - public List<String> getNextRanks(String rank, boolean includeSuppliedRank)
rank - public List<OccurrenceSourceDTO> getSourceInformation(Map<String,Integer> sources)
sources - public static void setDefaultParams(SearchRequestParams requestParams)
requestParams - public Map<String,Facet> addFacetMap(String[] filterQuery, Set<String> authIndexFields)
filterQuery - Copyright © 2014. All rights reserved.