public class SearchTemplates extends Object
Modifier and Type | Class and Description |
---|---|
class |
SearchTemplates.DefaultTermParser
Adds each term as a filter parameter using the name 'termX' where X is the index of the term.
|
class |
SearchTemplates.InitialTermParser
Adds the first letter of each term as a filter parameter using the name 'initialX' where X is the index of the
term.
|
static interface |
SearchTemplates.TermParser
Converts query terms into search filter parameters.
|
Modifier and Type | Field and Description |
---|---|
private String[] |
filterTemplates
Search filter templates.
|
private String |
searchRestrictions
Appended to every search filter to restrict results.
|
private SearchTemplates.TermParser[] |
termParsers
Term parsers for creating filter parameters.
|
Constructor and Description |
---|
SearchTemplates(String... templates)
Creates a new search templates.
|
Modifier and Type | Method and Description |
---|---|
private String |
concatFilters(String... filters)
Concatenates the supplied filters into a single filter will all arguments ANDED together.
|
SearchFilter[] |
format(Query query)
Creates the search filters using configured templates and the supplied query.
|
String |
getSearchRestrictions()
Returns the filter to use for search restrictions.
|
SearchTemplates.TermParser[] |
getTermParsers()
Returns the term parsers used for creating filter parameters.
|
void |
setSearchRestrictions(String restrictions)
Sets the filter to use for search restrictions.
|
void |
setTermParsers(SearchTemplates.TermParser... parsers)
Sets the term parsers used for creating filter parameters.
|
String |
toString() |
private final String[] filterTemplates
private String searchRestrictions
private SearchTemplates.TermParser[] termParsers
public SearchTemplates(String... templates)
templates
- list of search filterspublic String getSearchRestrictions()
public void setSearchRestrictions(String restrictions)
restrictions
- search restrictionspublic SearchTemplates.TermParser[] getTermParsers()
public void setTermParsers(SearchTemplates.TermParser... parsers)
parsers
- term parserspublic SearchFilter[] format(Query query)
query
- to create search filter withprivate String concatFilters(String... filters)
filters
- to concatenateCopyright © 2003-2019 Virginia Tech. All Rights Reserved.