Interface HstQuery


public interface HstQuery
  • Field Details

    • DEFAULT_LIMIT

      static final int DEFAULT_LIMIT
      The default limit that is used for a HstQuery. Use setLimit(int) if you need to override this value.
      See Also:
  • Method Details

    • setFilter

      void setFilter(BaseFilter filter)
    • getFilter

      BaseFilter getFilter()
    • createFilter

      Filter createFilter()
      Returns:
      a new empty Filter
    • setLimit

      void setLimit(int limit)
      Sets the limit of search results. Note that setting this value very high might influence performance negatively
      Parameters:
      limit -
    • getQueryAsString

      String getQueryAsString(boolean skipDefaultOrderBy) throws QueryException
      Returns the query as string. When skipDefaultOrder is TRUE, the string representation will only include an 'order by' clause when there is set one explicitly.
      Parameters:
      skipDefaultOrderBy -
      Returns:
      the query as string
      Throws:
      QueryException - if we cannot build the query string
    • getLimit

      int getLimit()
      Returns the limit of the HstQuery. If no limit is set, it returns the default HstQuery limit DEFAULT_LIMIT
      Returns:
      the limit
    • setOffset

      void setOffset(int offset)
      Sets the offset to start searching from. Default offset is -1 which means it is ignored. A negative offset will be ignored
      Parameters:
      offset -
    • getOffset

      int getOffset()
      Returns the offset of the HstQuery. If no offset is set through setOffset(int), the offset will be -1 and will be ignored
      Returns:
      the offset
    • addOrderByAscending

      void addOrderByAscending(String fieldNameAttribute)
      Order the object found case sensitive ascending
      Parameters:
      fieldNameAttribute - the name of the field used to sort the search result
    • addOrderByAscendingCaseInsensitive

      void addOrderByAscendingCaseInsensitive(String fieldNameAttribute)
      Order the object found case insensitive ascending
      Parameters:
      fieldNameAttribute - the name of the field used to sort the search result
    • addOrderByDescending

      void addOrderByDescending(String fieldNameAttribute)
      Order the object found case sensitive descending
      Parameters:
      fieldNameAttribute - the name of the field used to sort the search result
    • addOrderByDescendingCaseInsensitive

      void addOrderByDescendingCaseInsensitive(String fieldNameAttribute)
      Order the object found case insensitive descending
      Parameters:
      fieldNameAttribute - the name of the field used to sort the search result
    • addScopes

      void addScopes(List<HippoBean> scopes)
      add scopes to search in. If the exact scope is already added to exclude from the search, it is removed from the excluded list.
      Parameters:
      scopes -
    • addScopes

      void addScopes(Node[] scopes)
      add scopes to search in. If the exact scope is already added to exclude from the search, it is removed from the excluded list.
      Parameters:
      scopes -
    • excludeScopes

      void excludeScopes(List<HippoBean> scopes)
      add scopes to exclude from search. If the exact scope is already added as a scope to search in, it is removed from there
      Parameters:
      scopes -
    • excludeScopes

      void excludeScopes(Node[] scopes)
      add scopes to exclude from search. If the exact scope is already added as a scope to search in, it is removed from there
      Parameters:
      scopes -
    • execute

      HstQueryResult execute() throws QueryException
      The actual execution of the HstQuery. The HstQueryResult will never contain one and the same result twice. So, if a result matches the search criteria twice, it is still returned as one hit.
      Returns:
      HstQueryResult
      Throws:
      QueryException