public class SearchQueryUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SearchQueryUtils.Conjunction |
| Constructor and Description |
|---|
SearchQueryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
assembleConjunctiveQuery(String fieldName,
Collection<String> words,
SearchQueryUtils.Conjunction c)
Glue these words together into a query on a given field, joined by either
AND or OR.
|
static FieldMap |
fieldMap()
Create a builder object that can assemble a map of search result field
names to JSON field names.
|
static String |
getAlphaParameter(VitroRequest request)
Methods that can be used in multiple places, such as
IndividualListController and SearchIndividualsDataGetter
|
static long |
getIndividualCount(List<String> vclassUris) |
static int |
getPageParameter(VitroRequest request) |
static SearchQuery |
getQuery(List<String> vclassUris,
String alpha,
int page,
int pageSize)
builds a query with a type clause for each type in vclassUris, NAME_LOWERCASE filetred by
alpha, and just the hits for the page for pageSize.
|
static SearchQuery |
getRandomQuery(List<String> vclassUris,
int page,
int pageSize) |
static String |
makeMultiClassQuery(List<String> vclassUris) |
static List<Map<String,String>> |
parseAndFilterResponse(SearchResponse queryResponse,
FieldMap fieldMap,
SearchResponseFilter filter,
int maxNumberOfResults)
Parse a response into a list of maps, accepting only those maps that pass
a filter, and only up to a maximum number of records.
|
static AutoCompleteWords |
parseForAutoComplete(String searchTerm,
String delimiterPattern)
Create an AutoCompleteWords object that can be used to build an
auto-complete query.
|
static List<Map<String,String>> |
parseResponse(SearchResponse queryResponse,
FieldMap fieldMap)
Parse a response into a list of maps, one map for each document.
|
static List<String> |
parseWords(String typesString,
String wordDelimiter)
Break a string into a list of words, according to a RegEx delimiter.
|
public static AutoCompleteWords parseForAutoComplete(String searchTerm, String delimiterPattern)
public static FieldMap fieldMap()
public static List<Map<String,String>> parseResponse(SearchResponse queryResponse, FieldMap fieldMap)
public static List<Map<String,String>> parseAndFilterResponse(SearchResponse queryResponse, FieldMap fieldMap, SearchResponseFilter filter, int maxNumberOfResults)
public static List<String> parseWords(String typesString, String wordDelimiter)
public static String assembleConjunctiveQuery(String fieldName, Collection<String> words, SearchQueryUtils.Conjunction c)
public static String getAlphaParameter(VitroRequest request)
public static int getPageParameter(VitroRequest request)
public static SearchQuery getQuery(List<String> vclassUris, String alpha, int page, int pageSize)
public static SearchQuery getRandomQuery(List<String> vclassUris, int page, int pageSize)
Copyright © 2016. All rights reserved.