Class GeneralSearchBuilder

java.lang.Object
org.hippoecm.frontend.plugins.standards.search.GeneralSearchBuilder
Direct Known Subclasses:
TextSearchBuilder

public class GeneralSearchBuilder extends Object
  • Field Details

  • Constructor Details

    • GeneralSearchBuilder

      public GeneralSearchBuilder()
    • GeneralSearchBuilder

      public GeneralSearchBuilder(String queryName)
  • Method Details

    • 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)
    • buildTypesString

      protected String buildTypesString(String[] primaryTypes)
    • appendScope

      protected void appendScope(StringBuilder sb)
    • appendContains

      protected void appendContains(StringBuilder queryStringBuilder, String searchTerm) throws InvalidQueryException
      Throws:
      InvalidQueryException
    • formatJcrContains

      protected static String formatJcrContains(String containsTerm)
    • getWhereClause

      protected String getWhereClause(String value, boolean wildcardPostfix)
    • 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)
    • isoLatin1AccentReplacer

      public static String isoLatin1AccentReplacer(String input)