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(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url)protected voidbuildFacetParameters(SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url)protected voidbuildHightlightParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url)protected voidbuildPivotParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url)protected voidbuildRangeParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url)protected voidbuildShards(StringBuilder url, List<StoreRef> storeRefs)protected org.json.JSONObjectbuildStatsBody(StatsParameters searchParameters, String tenant, Locale locale)protected voidbuildStatsParameters(SearchParameters searchParameters, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url)protected StringbuildStatsUrl(StatsParameters searchParameters, String baseUrl, Locale locale, SolrStoreMappingWrapper mapping)voidbuildUrlParameters(SearchParameters searchParameters, boolean isSharded, org.apache.commons.codec.net.URLCodec encoder, StringBuilder url)Builds most of the Url parameters for a Solr Http request.org.json.JSONObjectexecute(StoreRef storeRef, String handler, HashMap<String,String> params)ResultSetexecuteQuery(SearchParameters searchParameters, String language)SolrStatsResultexecuteStatsQuery(StatsParameters searchParameters)Executes a solr query for statisticsStringgetAlternativeDictionary()intgetDefaultShardedFacetLimit()intgetDefaultUnshardedFacetLimit()DictionaryServicegetDictionaryService()Map<String,String>getLanguageMappings()intgetMaximumResultsFromUnlimitedQuery()NamespaceDAOgetNamespaceDAO()NodeServicegetNodeService()PermissionServicegetPermissionService()RepositoryStategetRepositoryState()ShardRegistrygetShardRegistry()TenantServicegetTenantService()voidinit()booleanisAnyDenyDenies()booleanisIncludeGroupsForRoleAdmin()booleanisSharded()booleanisUseDynamicShardRegistration()protected JSONResultpostSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor)protected JSONResultpostSolrQuery(org.apache.commons.httpclient.HttpClient httpClient, String url, org.json.JSONObject body, SolrJsonProcessor<?> jsonProcessor, String spellCheckParams)voidsetAlternativeDictionary(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(DictionaryService dictionaryService)voidsetIncludeGroupsForRoleAdmin(boolean includeGroupsForRoleAdmin)voidsetLanguageMappings(Map<String,String> languageMappings)voidsetMaximumResultsFromUnlimitedQuery(int maximumResultsFromUnlimitedQuery)voidsetNamespaceDAO(NamespaceDAO namespaceDAO)voidsetNodeDAO(NodeDAO nodeDAO)voidsetNodeService(NodeService nodeService)voidsetPermissionService(PermissionService permissionService)voidsetRepositoryState(RepositoryState repositoryState)voidsetShardRegistry(ShardRegistry shardRegistry)voidsetStoreMappings(List storeMappings)voidsetTenantService(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(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)
-
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 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(StatsParameters searchParameters)
Executes a solr query for statistics- Specified by:
executeStatsQueryin interfaceSolrQueryClient- 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:
executeQueryin interfaceSolrQueryClient
-
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 JSONResult 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:
UnsupportedEncodingExceptionIOExceptionorg.apache.commons.httpclient.HttpExceptionorg.apache.commons.httpclient.URIExceptionorg.json.JSONException
-
postSolrQuery
protected JSONResult 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:
UnsupportedEncodingExceptionIOExceptionorg.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 Exception- Specified by:
afterPropertiesSetin interfaceorg.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:
isShardedin interfaceSolrQueryClient- 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()
-
isAnyDenyDenies
public boolean isAnyDenyDenies()
-
getAlternativeDictionary
public String getAlternativeDictionary()
-
isIncludeGroupsForRoleAdmin
public boolean isIncludeGroupsForRoleAdmin()
-
getMaximumResultsFromUnlimitedQuery
public int getMaximumResultsFromUnlimitedQuery()
-
-