Class DefaultQueryParser

java.lang.Object
org.springframework.data.solr.core.QueryParserBase<SolrDataQuery>
org.springframework.data.solr.core.DefaultQueryParser
All Implemented Interfaces:
QueryParser

public class DefaultQueryParser extends QueryParserBase<SolrDataQuery>
Implementation of QueryParser.
Creates executable SolrQuery from Query by traversing Criteria. Reserved characters like + or - will be escaped to form a valid query.
  • Constructor Details

    • DefaultQueryParser

      public DefaultQueryParser(@Nullable org.springframework.data.mapping.context.MappingContext mappingContext)
      Create a new DefaultQueryParser using the provided MappingContext to map fields to domain domain type properties.
      Parameters:
      mappingContext - can be null.
      Since:
      4.0
  • Method Details

    • doConstructSolrQuery

      public final org.apache.solr.client.solrj.SolrQuery doConstructSolrQuery(SolrDataQuery query, @Nullable Class<?> domainType)
      Convert given Query into a SolrQuery executable via SolrClient
      Specified by:
      doConstructSolrQuery in class QueryParserBase<SolrDataQuery>
      Parameters:
      query - the source query to turn into a SolrQuery.
      domainType - can be null.
      Returns:
    • processHighlightOptions

      protected void processHighlightOptions(org.apache.solr.client.solrj.SolrQuery solrQuery, HighlightQuery query, @Nullable Class<?> domainType)
      Append highlighting parameters to SolrQuery
      Parameters:
      solrQuery - the target SolrQuery
      query - the source query.
      domainType - used for mapping fields to properties. Can be null.
    • createPerFieldOverrideParameterName

      protected String createPerFieldOverrideParameterName(Field field, String parameterName, @Nullable Class<?> domainType)
      Parameters:
      field - the source field.
      parameterName - the parameter name to append
      domainType - used for mapping fields to properties. Can be null.
      Returns:
    • appendFilterQuery

      protected void appendFilterQuery(org.apache.solr.client.solrj.SolrQuery solrQuery, List<FilterQuery> filterQueries, @Nullable Class<?> domainType)
      Set filter filter queries for SolrQuery
      Parameters:
      solrQuery -
      filterQueries -
      domainType - used for mapping fields to properties. Can be null.
    • appendSort

      protected void appendSort(org.apache.solr.client.solrj.SolrQuery solrQuery, @Nullable org.springframework.data.domain.Sort sort, @Nullable Class<?> domainType)
      Append sorting parameters to SolrQuery
      Parameters:
      solrQuery -
      sort -