Class SolrQueryHTTPClient

java.lang.Object
org.alfresco.repo.search.impl.solr.AbstractSolrQueryHTTPClient
org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient
All Implemented Interfaces:
SolrQueryClient, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

public class SolrQueryHTTPClient extends AbstractSolrQueryHTTPClient implements SolrQueryClient
Author:
Andy
  • Constructor Details

    • SolrQueryHTTPClient

      public SolrQueryHTTPClient()
  • Method Details

    • init

      public void init()
    • setAlternativeDictionary

      public void setAlternativeDictionary(String alternativeDictionary)
    • setRepositoryState

      public void setRepositoryState(RepositoryState repositoryState)
      Parameters:
      repositoryState - the repositoryState to set
    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setNodeDAO

      public void setNodeDAO(NodeDAO nodeDAO)
      Parameters:
      nodeDAO - the nodeDao to set
    • setPermissionService

      public void setPermissionService(PermissionService permissionService)
    • setTenantService

      public void setTenantService(TenantService tenantService)
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
    • setNamespaceDAO

      public void setNamespaceDAO(NamespaceDAO namespaceDAO)
    • setShardRegistry

      public void setShardRegistry(ShardRegistry shardRegistry)
    • setUseDynamicShardRegistration

      public void setUseDynamicShardRegistration(boolean useDynamicShardRegistration)
    • setLanguageMappings

      public void setLanguageMappings(Map<String,String> languageMappings)
    • setStoreMappings

      public void setStoreMappings(List storeMappings)
    • setIncludeGroupsForRoleAdmin

      public void setIncludeGroupsForRoleAdmin(boolean includeGroupsForRoleAdmin)
      Parameters:
      includeGroupsForRoleAdmin - the includeGroupsForRoleAdmin to set
    • setMaximumResultsFromUnlimitedQuery

      public void setMaximumResultsFromUnlimitedQuery(int maximumResultsFromUnlimitedQuery)
      Parameters:
      maximumResultsFromUnlimitedQuery - the maximum number of results to request from an otherwise unlimited query
    • setAnyDenyDenies

      public void setAnyDenyDenies(boolean anyDenyDenies)
      When set, a single DENIED ACL entry for any authority will result in access being denied as a whole. See system property security.anyDenyDenies
      Parameters:
      anyDenyDenies - boolean
    • setDefaultUnshardedFacetLimit

      public void setDefaultUnshardedFacetLimit(int defaultUnshardedFacetLimit)
      Parameters:
      defaultUnshardedFacetLimit - the defaultUnshardedFacetLimit to set
    • setDefaultShardedFacetLimit

      public void setDefaultShardedFacetLimit(int defaultShardedFacetLimit)
      Parameters:
      defaultShardedFacetLimit - the defaultShardedFacetLimit to set
    • executeStatsQuery

      public SolrStatsResult executeStatsQuery(StatsParameters searchParameters)
      Executes a solr query for statistics
      Specified by:
      executeStatsQuery in interface SolrQueryClient
      Parameters:
      searchParameters - StatsParameters
      Returns:
      SolrStatsResult
    • buildStatsUrl

      protected String buildStatsUrl(StatsParameters searchParameters, String baseUrl, Locale locale, SolrStoreMappingWrapper mapping) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • buildShards

      protected void buildShards(StringBuilder url, List<StoreRef> storeRefs)
    • buildStatsBody

      protected org.json.JSONObject buildStatsBody(StatsParameters searchParameters, String tenant, Locale locale) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • executeQuery

      public ResultSet executeQuery(SearchParameters searchParameters, String language)
      Specified by:
      executeQuery in interface SolrQueryClient
    • buildUrlParameters

      public void buildUrlParameters(SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url) throws UnsupportedEncodingException
      Builds most of the Url parameters for a Solr Http request.
      Parameters:
      searchParameters -
      isSharded -
      encoder -
      url -
      Throws:
      UnsupportedEncodingException
    • buildFacetParameters

      protected void buildFacetParameters(SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • buildStatsParameters

      protected void buildStatsParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • buildPivotParameters

      protected void buildPivotParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • buildRangeParameters

      protected void buildRangeParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • buildHightlightParameters

      protected void buildHightlightParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • buildFacetIntervalParameters

      protected void buildFacetIntervalParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • postSolrQuery

      protected SearchEngineResultMetadata postSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor) throws UnsupportedEncodingException, IOException, org.apache.commons.httpclient.HttpException, org.apache.commons.httpclient.URIException, org.json.JSONException
      Throws:
      UnsupportedEncodingException
      IOException
      org.apache.commons.httpclient.HttpException
      org.apache.commons.httpclient.URIException
      org.json.JSONException
    • postSolrQuery

      protected SearchEngineResultMetadata postSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor, String spellCheckParams) throws UnsupportedEncodingException, IOException, org.apache.commons.httpclient.HttpException, org.apache.commons.httpclient.URIException, org.json.JSONException
      Throws:
      UnsupportedEncodingException
      IOException
      org.apache.commons.httpclient.HttpException
      org.apache.commons.httpclient.URIException
      org.json.JSONException
    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • execute

      public org.json.JSONObject execute(StoreRef storeRef, String handler, HashMap<String,String> params)
      Parameters:
      storeRef -
      handler -
      params -
      Returns:
    • isSharded

      public boolean isSharded()
      Specified by:
      isSharded in interface SolrQueryClient
      Returns:
    • getTenantService

      public TenantService getTenantService()
    • getDictionaryService

      public DictionaryService getDictionaryService()
    • getNodeService

      public NodeService getNodeService()
    • getShardRegistry

      public ShardRegistry getShardRegistry()
    • getRepositoryState

      public RepositoryState getRepositoryState()
    • isUseDynamicShardRegistration

      public boolean isUseDynamicShardRegistration()
    • getDefaultUnshardedFacetLimit

      public int getDefaultUnshardedFacetLimit()
    • getDefaultShardedFacetLimit

      public int getDefaultShardedFacetLimit()
    • getNamespaceDAO

      public NamespaceDAO getNamespaceDAO()
    • getPermissionService

      public PermissionService getPermissionService()
    • getLanguageMappings

      public Map<String,String> getLanguageMappings()
    • isAnyDenyDenies

      public boolean isAnyDenyDenies()
    • getAlternativeDictionary

      public String getAlternativeDictionary()
    • isIncludeGroupsForRoleAdmin

      public boolean isIncludeGroupsForRoleAdmin()
    • getMaximumResultsFromUnlimitedQuery

      public int getMaximumResultsFromUnlimitedQuery()