Class SolrQueryMethod

java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.solr.repository.query.SolrQueryMethod

public class SolrQueryMethod extends org.springframework.data.repository.query.QueryMethod
Solr specific implementation of QueryMethod taking care of Query
  • Constructor Details

    • SolrQueryMethod

      public SolrQueryMethod(Method method, org.springframework.data.repository.core.RepositoryMetadata metadata, org.springframework.data.projection.ProjectionFactory factory, SolrEntityInformationCreator solrInformationCreator)
  • Method Details

    • hasAnnotatedQuery

      public boolean hasAnnotatedQuery()
      Returns:
      true if Query.value() is not blank
    • hasQueryAnnotation

      public boolean hasQueryAnnotation()
      Returns:
      true if Query is not blank
    • hasAnnotatedNamedQueryName

      public boolean hasAnnotatedNamedQueryName()
      Returns:
      true if Query.name() is not blank
    • hasProjectionFields

      public boolean hasProjectionFields()
      Returns:
      true if Query.fields() is not empty
    • getProjectionFields

      public List<String> getProjectionFields()
      Returns:
      empty collection if Query.fields() is empty
    • getTimeAllowed

      @Nullable public Integer getTimeAllowed()
      Returns:
      null if Query.timeAllowed() is null or negative
    • isFacetQuery

      public boolean isFacetQuery()
      Returns:
      true if hasFacetFields() or hasFacetQueries()
    • hasFacetFields

      public boolean hasFacetFields()
      Returns:
      true if Facet.fields() is not empty
    • hasPivotFields

      public boolean hasPivotFields()
      Returns:
      true if is not empty
    • getFacetFields

      public List<String> getFacetFields()
      Returns:
      empty collection if Facet.fields() is empty
    • getFacetQueries

      public List<String> getFacetQueries()
      Returns:
      empty collection if Facet.queries() is empty
    • getPivotFields

      public List<String[]> getPivotFields()
    • hasFacetQueries

      public boolean hasFacetQueries()
      Returns:
      true if Facet.queries() is not empty
    • getFacetLimit

      @Nullable public Integer getFacetLimit()
      Returns:
      value of Facet.limit()
    • getFacetMinCount

      @Nullable public Integer getFacetMinCount()
      Returns:
      value of Facet.minCount()
    • getFacetPrefix

      @Nullable public String getFacetPrefix()
      Returns:
      value of Facet.prefix()
    • hasStatsDefinition

      public boolean hasStatsDefinition()
      Returns:
      if something was configured within Stats
      Since:
      1.4
    • isFieldStatsCountDistinctEnable

      public boolean isFieldStatsCountDistinctEnable()
      Returns:
      true if stats is distinct
      Since:
      1.4
    • getFieldStats

      public List<String> getFieldStats()
      Returns:
      value of Stats.value()
      Since:
      1.4
    • getStatsFacets

      public List<String> getStatsFacets()
      Returns:
      value of Stats.facets()
      Since:
      1.4
    • getStatsSelectiveFacets

      public Map<String,String[]> getStatsSelectiveFacets()
      Returns:
      value of facets used in Stats.selective()
      Since:
      1.4
    • getStatsSelectiveCountDistinctFields

      public Collection<String> getStatsSelectiveCountDistinctFields()
      Returns:
      value of facets used in Stats.selective()
      Since:
      1.4
    • hasFilterQuery

      public boolean hasFilterQuery()
      Returns:
      true if Query.filters() is not empty
    • isDeleteQuery

      public boolean isDeleteQuery()
      Returns:
      value of Query.delete()
      Since:
      1.2
    • isHighlightQuery

      public boolean isHighlightQuery()
      Returns:
      if Highlight is present
    • getHighlightFieldNames

      public List<String> getHighlightFieldNames()
      Returns:
      empty collection if Highlight.fields() is empty
    • getHighlightQuery

      @Nullable public String getHighlightQuery()
      Returns:
      null if Highlight.query() is blank
    • getHighlighSnipplets

      @Nullable public Integer getHighlighSnipplets()
      Returns:
      value of Highlight.snipplets() or null if negative
    • getHighlightFragsize

      @Nullable public Integer getHighlightFragsize()
      Returns:
      value of Highlight.fragsize() or null if negative
    • getHighlightFormatter

      @Nullable public String getHighlightFormatter()
      Returns:
      value of Highlight.formatter() or null if blank
    • getHighlightPrefix

      @Nullable public String getHighlightPrefix()
      Returns:
      value of Highlight.prefix() or null if blank
    • getHighlightPostfix

      @Nullable public String getHighlightPostfix()
      Returns:
      value of Highlight.postfix() or null if blank
    • hasHighlightFields

      public boolean hasHighlightFields()
      Returns:
      true if Highlight.fields() is not empty
    • getDefaultOperator

      public Query.Operator getDefaultOperator()
      Returns:
      value of Query.defaultOperator() or Query.Operator.NONE if not set
    • getDefType

      @Nullable public String getDefType()
      Returns:
      null if Query.defType() not set
    • getRequestHandler

      @Nullable public String getRequestHandler()
      Returns:
      null if Query.requestHandler() not set
    • getSpellcheckAnnotation

      @Nullable public Spellcheck getSpellcheckAnnotation()
      Returns:
      Since:
      2.1
    • hasSpellcheck

      public boolean hasSpellcheck()
      Returns:
      Since:
      2.1
    • getSpellcheckOptions

      @Nullable public SpellcheckOptions getSpellcheckOptions()
      Returns:
      Since:
      2.1
    • getNamedQueryName

      public String getNamedQueryName()
      Overrides:
      getNamedQueryName in class org.springframework.data.repository.query.QueryMethod
    • returnsOptional

      public boolean returnsOptional()
      Returns:
      true if the method return type is Optional.
      Since:
      2.0
    • createParameters

      protected SolrParameters createParameters(Method method)
      Overrides:
      createParameters in class org.springframework.data.repository.query.QueryMethod
    • getParameters

      public SolrParameters getParameters()
      Overrides:
      getParameters in class org.springframework.data.repository.query.QueryMethod