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
-
-
Field Summary
-
Fields inherited from class org.alfresco.repo.search.impl.solr.AbstractSolrQueryHTTPClient
DEFAULT_SAVEPOST_BUFFER, HIGHLIGHT_PARAMS_ALTERNATE_FIELD, HIGHLIGHT_PARAMS_ALTERNATE_FIELD_LENGTH, HIGHLIGHT_PARAMS_FIELD_MATCH, HIGHLIGHT_PARAMS_FIELDS, HIGHLIGHT_PARAMS_FORMATTER, HIGHLIGHT_PARAMS_FRAGMENTER, HIGHLIGHT_PARAMS_FRAGSIZE, HIGHLIGHT_PARAMS_HIGHLIGHT, HIGHLIGHT_PARAMS_HIGHLIGHT_MULTI_TERM, HIGHLIGHT_PARAMS_INCREMENT, HIGHLIGHT_PARAMS_MAX_CHARS, HIGHLIGHT_PARAMS_MAX_RE_CHARS, HIGHLIGHT_PARAMS_MERGE_CONTIGUOUS_FRAGMENTS, HIGHLIGHT_PARAMS_PATTERN, HIGHLIGHT_PARAMS_REGEX, HIGHLIGHT_PARAMS_SIMPLE, HIGHLIGHT_PARAMS_SIMPLE_POST, HIGHLIGHT_PARAMS_SIMPLE_PRE, HIGHLIGHT_PARAMS_SLOP, HIGHLIGHT_PARAMS_SNIPPETS, HIGHLIGHT_PARAMS_USE_PHRASE_HIGHLIGHTER
-
-
Constructor Summary
Constructors Constructor Description SolrQueryHTTPClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected voidbuildFacetIntervalParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url)protected voidbuildFacetParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url)protected voidbuildHightlightParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url)protected voidbuildPivotParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url)protected voidbuildRangeParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url)protected voidbuildShards(java.lang.StringBuilder url, java.util.List<org.alfresco.service.cmr.repository.StoreRef> storeRefs)protected org.json.JSONObjectbuildStatsBody(org.alfresco.service.cmr.search.StatsParameters searchParameters, java.lang.String tenant, java.util.Locale locale)protected voidbuildStatsParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url)protected java.lang.StringbuildStatsUrl(org.alfresco.service.cmr.search.StatsParameters searchParameters, java.lang.String baseUrl, java.util.Locale locale, SolrStoreMappingWrapper mapping)voidbuildUrlParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url)Builds most of the Url parameters for a Solr Http request.org.json.JSONObjectexecute(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String handler, java.util.HashMap<java.lang.String,java.lang.String> params)org.alfresco.service.cmr.search.ResultSetexecuteQuery(org.alfresco.service.cmr.search.SearchParameters searchParameters, java.lang.String language)SolrStatsResultexecuteStatsQuery(org.alfresco.service.cmr.search.StatsParameters searchParameters)Executes a solr query for statisticsjava.lang.StringgetAlternativeDictionary()intgetDefaultShardedFacetLimit()intgetDefaultUnshardedFacetLimit()org.alfresco.service.cmr.dictionary.DictionaryServicegetDictionaryService()java.util.Map<java.lang.String,java.lang.String>getLanguageMappings()intgetMaximumResultsFromUnlimitedQuery()org.alfresco.repo.dictionary.NamespaceDAOgetNamespaceDAO()org.alfresco.service.cmr.repository.NodeServicegetNodeService()org.alfresco.service.cmr.security.PermissionServicegetPermissionService()RepositoryStategetRepositoryState()ShardRegistrygetShardRegistry()org.alfresco.repo.tenant.TenantServicegetTenantService()voidinit()booleanisAnyDenyDenies()booleanisIncludeGroupsForRoleAdmin()booleanisSharded()booleanisUseDynamicShardRegistration()protected JSONResultpostSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, java.lang.String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor)protected JSONResultpostSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, java.lang.String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor, java.lang.String spellCheckParams)voidsetAlternativeDictionary(java.lang.String alternativeDictionary)voidsetAnyDenyDenies(boolean anyDenyDenies)When set, a single DENIED ACL entry for any authority will result in access being denied as a whole.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)voidsetDefaultShardedFacetLimit(int defaultShardedFacetLimit)voidsetDefaultUnshardedFacetLimit(int defaultUnshardedFacetLimit)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetIncludeGroupsForRoleAdmin(boolean includeGroupsForRoleAdmin)voidsetLanguageMappings(java.util.Map<java.lang.String,java.lang.String> languageMappings)voidsetMaximumResultsFromUnlimitedQuery(int maximumResultsFromUnlimitedQuery)voidsetNamespaceDAO(org.alfresco.repo.dictionary.NamespaceDAO namespaceDAO)voidsetNodeDAO(NodeDAO nodeDAO)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)voidsetRepositoryState(RepositoryState repositoryState)voidsetShardRegistry(ShardRegistry shardRegistry)voidsetStoreMappings(java.util.List storeMappings)voidsetTenantService(org.alfresco.repo.tenant.TenantService tenantService)voidsetUseDynamicShardRegistration(boolean useDynamicShardRegistration)-
Methods inherited from class org.alfresco.repo.search.impl.solr.AbstractSolrQueryHTTPClient
postQuery
-
-
-
-
Method Detail
-
init
public void init()
-
setAlternativeDictionary
public void setAlternativeDictionary(java.lang.String alternativeDictionary)
-
setRepositoryState
public void setRepositoryState(RepositoryState repositoryState)
- Parameters:
repositoryState- the repositoryState to set
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setNodeDAO
public void setNodeDAO(NodeDAO nodeDAO)
- Parameters:
nodeDAO- the nodeDao to set
-
setPermissionService
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
-
setTenantService
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
setNamespaceDAO
public void setNamespaceDAO(org.alfresco.repo.dictionary.NamespaceDAO namespaceDAO)
-
setShardRegistry
public void setShardRegistry(ShardRegistry shardRegistry)
-
setUseDynamicShardRegistration
public void setUseDynamicShardRegistration(boolean useDynamicShardRegistration)
-
setLanguageMappings
public void setLanguageMappings(java.util.Map<java.lang.String,java.lang.String> languageMappings)
-
setStoreMappings
public void setStoreMappings(java.util.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 propertysecurity.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(org.alfresco.service.cmr.search.StatsParameters searchParameters)
Executes a solr query for statistics- Specified by:
executeStatsQueryin interfaceSolrQueryClient- Parameters:
searchParameters- StatsParameters- Returns:
- SolrStatsResult
-
buildStatsUrl
protected java.lang.String buildStatsUrl(org.alfresco.service.cmr.search.StatsParameters searchParameters, java.lang.String baseUrl, java.util.Locale locale, SolrStoreMappingWrapper mapping) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
buildShards
protected void buildShards(java.lang.StringBuilder url, java.util.List<org.alfresco.service.cmr.repository.StoreRef> storeRefs)
-
buildStatsBody
protected org.json.JSONObject buildStatsBody(org.alfresco.service.cmr.search.StatsParameters searchParameters, java.lang.String tenant, java.util.Locale locale) throws org.json.JSONException- Throws:
org.json.JSONException
-
executeQuery
public org.alfresco.service.cmr.search.ResultSet executeQuery(org.alfresco.service.cmr.search.SearchParameters searchParameters, java.lang.String language)- Specified by:
executeQueryin interfaceSolrQueryClient
-
buildUrlParameters
public void buildUrlParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url) throws java.io.UnsupportedEncodingExceptionBuilds most of the Url parameters for a Solr Http request.- Parameters:
searchParameters-isSharded-encoder-url-- Throws:
java.io.UnsupportedEncodingException
-
buildFacetParameters
protected void buildFacetParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
buildStatsParameters
protected void buildStatsParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
buildPivotParameters
protected void buildPivotParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
buildRangeParameters
protected void buildRangeParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
buildHightlightParameters
protected void buildHightlightParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
buildFacetIntervalParameters
protected void buildFacetIntervalParameters(org.alfresco.service.cmr.search.SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, java.lang.StringBuilder url) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
postSolrQuery
protected JSONResult postSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, java.lang.String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor) throws java.io.UnsupportedEncodingException, java.io.IOException, org.apache.commons.httpclient.HttpException, org.apache.commons.httpclient.URIException, org.json.JSONException
- Throws:
java.io.UnsupportedEncodingExceptionjava.io.IOExceptionorg.apache.commons.httpclient.HttpExceptionorg.apache.commons.httpclient.URIExceptionorg.json.JSONException
-
postSolrQuery
protected JSONResult postSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, java.lang.String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor, java.lang.String spellCheckParams) throws java.io.UnsupportedEncodingException, java.io.IOException, org.apache.commons.httpclient.HttpException, org.apache.commons.httpclient.URIException, org.json.JSONException
- Throws:
java.io.UnsupportedEncodingExceptionjava.io.IOExceptionorg.apache.commons.httpclient.HttpExceptionorg.apache.commons.httpclient.URIExceptionorg.json.JSONException
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
execute
public org.json.JSONObject execute(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String handler, java.util.HashMap<java.lang.String,java.lang.String> params)- Parameters:
storeRef-handler-params-- Returns:
-
isSharded
public boolean isSharded()
- Specified by:
isShardedin interfaceSolrQueryClient- Returns:
-
getTenantService
public org.alfresco.repo.tenant.TenantService getTenantService()
-
getDictionaryService
public org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()
-
getNodeService
public org.alfresco.service.cmr.repository.NodeService getNodeService()
-
getShardRegistry
public ShardRegistry getShardRegistry()
-
getRepositoryState
public RepositoryState getRepositoryState()
-
isUseDynamicShardRegistration
public boolean isUseDynamicShardRegistration()
-
getDefaultUnshardedFacetLimit
public int getDefaultUnshardedFacetLimit()
-
getDefaultShardedFacetLimit
public int getDefaultShardedFacetLimit()
-
getNamespaceDAO
public org.alfresco.repo.dictionary.NamespaceDAO getNamespaceDAO()
-
getPermissionService
public org.alfresco.service.cmr.security.PermissionService getPermissionService()
-
getLanguageMappings
public java.util.Map<java.lang.String,java.lang.String> getLanguageMappings()
-
isAnyDenyDenies
public boolean isAnyDenyDenies()
-
getAlternativeDictionary
public java.lang.String getAlternativeDictionary()
-
isIncludeGroupsForRoleAdmin
public boolean isIncludeGroupsForRoleAdmin()
-
getMaximumResultsFromUnlimitedQuery
public int getMaximumResultsFromUnlimitedQuery()
-
-