Class GeneralSearchBuilder
- java.lang.Object
-
- org.hippoecm.frontend.plugins.standards.search.GeneralSearchBuilder
-
- Direct Known Subclasses:
TextSearchBuilder
public class GeneralSearchBuilder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
TEXT_QUERY_NAME
-
Constructor Summary
Constructors Constructor Description GeneralSearchBuilder()
GeneralSearchBuilder(String queryName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendContains(StringBuilder queryStringBuilder, String searchTerm)
protected void
appendExcludedPrimaryNodeTypeFilter(StringBuilder sb)
protected void
appendExtraWhereClauses(StringBuilder queryStringBuilder)
Overriding classes can append extra where clauses.protected void
appendIncludedPrimaryNodeTypeFilter(StringBuilder sb)
protected void
appendOrderByClause(StringBuilder queryStringBuilder)
protected void
appendScope(StringBuilder sb)
protected String
buildTypesString(String[] primaryTypes)
protected static String
formatJcrContains(String containsTerm)
protected String
getIgnoredChars()
protected String[]
getIncludePrimaryTypes()
protected int
getMinimalLength()
Get the minimal lentgh a search term must have before wildcarding is applied.protected StringBuilder
getQueryStringBuilder()
Makes the JCR Xpath query stringTextSearchResultModel
getResultModel()
protected String[]
getScope()
String
getText()
protected String
getWhereClause(String value, boolean wildcardPostfix)
static String
isoLatin1AccentReplacer(String input)
protected boolean
isWildcardSearch()
void
setExcludedPrimaryTypes(String[] excludedPrimaryTypes)
void
setIgnoredChars(String ignoredChars)
void
setIncludePrimaryTypes(String[] includePrimaryTypes)
Sets the JCR primary types to search for.void
setLimit(int limit)
void
setMinimalLength(int minimalLength)
Set the minimal length a search term must have before wildcarding is applied.void
setScope(String[] paths)
void
setText(String value)
void
setWildcardSearch(boolean wildcardSearch)
-
-
-
Field Detail
-
TEXT_QUERY_NAME
public static final String TEXT_QUERY_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GeneralSearchBuilder
public GeneralSearchBuilder()
-
GeneralSearchBuilder
public GeneralSearchBuilder(String queryName)
-
-
Method Detail
-
setScope
public void setScope(String[] paths)
-
setLimit
public void setLimit(int limit)
-
setIncludePrimaryTypes
public void setIncludePrimaryTypes(String[] includePrimaryTypes)
Sets the JCR primary types to search for.- Parameters:
includePrimaryTypes
-String
[] of primary types
-
setExcludedPrimaryTypes
public void setExcludedPrimaryTypes(String[] excludedPrimaryTypes)
-
setWildcardSearch
public void setWildcardSearch(boolean wildcardSearch)
-
setIgnoredChars
public void setIgnoredChars(String ignoredChars)
-
setText
public void setText(String value)
-
getText
public String getText()
-
setMinimalLength
public void setMinimalLength(int minimalLength)
Set the minimal length a search term must have before wildcarding is applied.
-
getMinimalLength
protected int getMinimalLength()
Get the minimal lentgh a search term must have before wildcarding is applied.
-
getIncludePrimaryTypes
protected String[] getIncludePrimaryTypes()
-
getScope
protected String[] getScope()
-
getIgnoredChars
protected String getIgnoredChars()
-
isWildcardSearch
protected boolean isWildcardSearch()
-
getResultModel
public TextSearchResultModel getResultModel()
-
getQueryStringBuilder
protected StringBuilder getQueryStringBuilder()
Makes the JCR Xpath query string- Returns:
- StringBuilder that represents the JCR Xpath query
-
appendIncludedPrimaryNodeTypeFilter
protected void appendIncludedPrimaryNodeTypeFilter(StringBuilder sb)
-
appendExcludedPrimaryNodeTypeFilter
protected void appendExcludedPrimaryNodeTypeFilter(StringBuilder sb)
-
appendScope
protected void appendScope(StringBuilder sb)
-
appendContains
protected void appendContains(StringBuilder queryStringBuilder, String searchTerm) throws javax.jcr.query.InvalidQueryException
- Throws:
javax.jcr.query.InvalidQueryException
-
appendExtraWhereClauses
protected void appendExtraWhereClauses(StringBuilder queryStringBuilder)
Overriding classes can append extra where clauses. Enclose the clause between square braces.- Parameters:
queryStringBuilder
- with the partly built up xpath query.
-
appendOrderByClause
protected void appendOrderByClause(StringBuilder queryStringBuilder)
-
-