Class FulltextSearchQuery

java.lang.Object
ch.tocco.nice2.enterprisesearch.api.FulltextSearchQuery
All Implemented Interfaces:
Serializable

public class FulltextSearchQuery extends Object implements Serializable
A data transfer object for a fulltext index search query. The builder-pattern is supported for setting up a query (e.g. #withLimit or #withEntityType)
See Also:
  • Constructor Details

    • FulltextSearchQuery

      public FulltextSearchQuery()
    • FulltextSearchQuery

      public FulltextSearchQuery(String queryString)
      See Also:
  • Method Details

    • addSorting

    • getSorting

      public List<FulltextSearchQuery.Sort> getSorting()
    • addAdditionalParam

      public FulltextSearchQuery addAdditionalParam(String key, String value)
    • getAdditionalParams

      public Map<String,String> getAdditionalParams()
    • addFields

      public FulltextSearchQuery addFields(String... fields)
    • getFields

      public Set<String> getFields()
    • isFieldRequested

      public boolean isFieldRequested(String field)
    • withQueryString

      public FulltextSearchQuery withQueryString(String queryString)
      See Also:
    • withEntityType

      public FulltextSearchQuery withEntityType(@Nullable @Nullable String entityType)
      See Also:
    • withLimit

      public FulltextSearchQuery withLimit(int limit)
      See Also:
    • withOffset

      public FulltextSearchQuery withOffset(int offset)
    • withMinimalIndexPriority

      public FulltextSearchQuery withMinimalIndexPriority(int minimalIndexPriority)
      See Also:
    • secure

      public FulltextSearchQuery secure(boolean secure)
      See Also:
    • getQueryString

      public String getQueryString()
      A query string which can also contain specific search query syntax (e.g. Lucene)
    • setQueryString

      public void setQueryString(String queryString)
      See Also:
    • getEntityType

      @Nullable public @Nullable String getEntityType()
      If specified, only results of the specified entity type will be returned.
    • setEntityType

      public void setEntityType(@Nullable @Nullable String entityType)
      See Also:
    • getLimit

      public int getLimit()
      If specified, the result will not have more result documents than specified.
    • setLimit

      public void setLimit(int limit)
      See Also:
    • getOffset

      @Nullable public @Nullable Integer getOffset()
    • setOffset

      public void setOffset(int offset)
    • getSearchAfter

      @Nullable public @Nullable String getSearchAfter()
    • setSearchAfter

      public void setSearchAfter(String searchAfter)
    • getMinimalIndexPriority

      public int getMinimalIndexPriority()
      If specified, the result will only contain documents with are not lower than minimalIndexPriority. Only gets respected when no entity type is specified.
    • setMinimalIndexPriority

      public void setMinimalIndexPriority(int minimalIndexPriority)
      See Also:
    • isSecure

      public boolean isSecure()
      If true, every result document will be checked against current read permissions (and will not be returned if current user has no reads to read this entity).
    • setSecure

      public void setSecure(boolean secure)
      See Also:
    • withConditionForEntityType

      public FulltextSearchQuery withConditionForEntityType(String entityType, Condition condition)
      Provided condition will be added to load-check-query (only if secure mode is active).
    • getConditionForEntityType

      public Optional<Condition> getConditionForEntityType(String entityType)
    • toString

      public String toString()
      Overrides:
      toString in class Object