Spring Data Solr

org.springframework.data.solr.repository.query
Class SolrQueryMethod

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

public class SolrQueryMethod
extends QueryMethod

Solr specific implementation of QueryMethod taking care of Query

Author:
Christoph Strobl, Luke Corpe, Andrey Paramonov, Francisco Spaeth

Constructor Summary
SolrQueryMethod(Method method, RepositoryMetadata metadata, SolrEntityInformationCreator solrInformationCreator)
           
 
Method Summary
protected  SolrParameters createParameters(Method method)
           
 Query.Operator getDefaultOperator()
           
 String getDefType()
           
 SolrEntityInformation<?,?> getEntityInformation()
           
 List<String> getFacetFields()
           
 Integer getFacetLimit()
           
 Integer getFacetMinCount()
           
 String getFacetPrefix()
           
 List<String> getFacetQueries()
           
 Integer getHighlighSnipplets()
           
 List<String> getHighlightFieldNames()
           
 String getHighlightFormatter()
           
 Integer getHighlightFragsize()
           
 String getHighlightPostfix()
           
 String getHighlightPrefix()
           
 String getHighlightQuery()
           
 String getNamedQueryName()
           
 SolrParameters getParameters()
           
 List<String> getPivotFields()
           
 List<String> getProjectionFields()
           
 String getRequestHandler()
           
 Integer getTimeAllowed()
           
 boolean hasAnnotatedNamedQueryName()
           
 boolean hasAnnotatedQuery()
           
 boolean hasFacetFields()
           
 boolean hasFacetQueries()
           
 boolean hasFilterQuery()
           
 boolean hasHighlightFields()
           
 boolean hasPivotFields()
           
 boolean hasProjectionFields()
           
 boolean hasQueryAnnotation()
           
 boolean isFacetQuery()
           
 boolean isHighlightQuery()
           
 
Methods inherited from class org.springframework.data.repository.query.QueryMethod
getDomainClass, getName, getReturnedObjectType, isCollectionQuery, isModifyingQuery, isPageQuery, isQueryForEntity, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SolrQueryMethod

public SolrQueryMethod(Method method,
                       RepositoryMetadata metadata,
                       SolrEntityInformationCreator solrInformationCreator)
Method Detail

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

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 Facet.pivotFields() 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

public Integer getFacetLimit()
Returns:
value of Facet.limit()

getFacetMinCount

public Integer getFacetMinCount()
Returns:
value of Facet.minCount()

getFacetPrefix

public String getFacetPrefix()
Returns:
value of Facet.prefix()

hasFilterQuery

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

isHighlightQuery

public boolean isHighlightQuery()
Returns:
if Highlight is present

getHighlightFieldNames

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

getHighlightQuery

public String getHighlightQuery()
Returns:
null if Highlight.query() is blank

getHighlighSnipplets

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

getHighlightFragsize

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

getHighlightFormatter

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

getHighlightPrefix

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

getHighlightPostfix

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

public String getDefType()
Returns:
null if Query.defType() not set

getRequestHandler

public String getRequestHandler()
Returns:
null if Query.requestHandler() not set

getEntityInformation

public SolrEntityInformation<?,?> getEntityInformation()
Overrides:
getEntityInformation in class QueryMethod

getNamedQueryName

public String getNamedQueryName()
Overrides:
getNamedQueryName in class QueryMethod

createParameters

protected SolrParameters createParameters(Method method)
Overrides:
createParameters in class QueryMethod

getParameters

public SolrParameters getParameters()
Overrides:
getParameters in class QueryMethod

Spring Data Solr

Copyright © 2011-2014-2014 Pivotal. All Rights Reserved.