mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Feature/search 2446 (#90)
* [SEARCH-2446] Changes for supporting ElasticSearchSearchService
This commit is contained in:
@@ -50,23 +50,36 @@ import org.alfresco.service.namespace.QName;
|
||||
@AlfrescoPublicApi
|
||||
public interface SearchService
|
||||
{
|
||||
public static final String LANGUAGE_LUCENE = "lucene";
|
||||
String LANGUAGE_LUCENE = "lucene";
|
||||
|
||||
public static final String LANGUAGE_XPATH = "xpath";
|
||||
String LANGUAGE_XPATH = "xpath";
|
||||
|
||||
public static final String LANGUAGE_FTS_ALFRESCO = "fts-alfresco";
|
||||
String LANGUAGE_FTS_ALFRESCO = "fts-alfresco";
|
||||
|
||||
public static final String LANGUAGE_SOLR_FTS_ALFRESCO = "solr-fts-alfresco";
|
||||
String LANGUAGE_CMIS_STRICT = "cmis-strict";
|
||||
|
||||
public static final String LANGUAGE_CMIS_STRICT = "cmis-strict";
|
||||
String LANGUAGE_CMIS_ALFRESCO = "cmis-alfresco";
|
||||
|
||||
public static final String LANGUAGE_CMIS_ALFRESCO = "cmis-alfresco";
|
||||
String LANGUAGE_INDEX_CMIS = "index-cmis";
|
||||
|
||||
public static final String LANGUAGE_SOLR_CMIS = "solr-cmis";
|
||||
String LANGUAGE_INDEX_ALFRESCO = "index-alfresco";
|
||||
|
||||
public static final String LANGUAGE_SOLR_ALFRESCO = "solr-alfresco";
|
||||
String LANGUAGE_INDEX_SQL = "index-sql";
|
||||
|
||||
public static final String LANGUAGE_SOLR_SQL = "solr-sql";
|
||||
String LANGUAGE_INDEX_FTS_ALFRESCO = "index-fts-alfresco";
|
||||
|
||||
// Old language names for solr subsystems retro compatibility
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_FTS_ALFRESCO = "solr-fts-alfresco";
|
||||
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_CMIS = "solr-cmis";
|
||||
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_ALFRESCO = "solr-alfresco";
|
||||
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_SQL = "solr-sql";
|
||||
|
||||
/**
|
||||
* Search against a store. Pulls back all attributes on each node. Does not
|
||||
@@ -81,7 +94,7 @@ public interface SearchService
|
||||
* @return Returns the query results
|
||||
*/
|
||||
@Auditable(parameters = {"store", "language", "query"})
|
||||
public ResultSet query(StoreRef store, String language, String query);
|
||||
ResultSet query(StoreRef store, String language, String query);
|
||||
|
||||
/**
|
||||
* Search against a store.
|
||||
@@ -98,8 +111,8 @@ public interface SearchService
|
||||
* @return Returns the query results
|
||||
*/
|
||||
@Auditable(parameters = {"store", "language", "query", "queryParameterDefinitions"})
|
||||
public ResultSet query(StoreRef store, String language, String query,
|
||||
QueryParameterDefinition[] queryParameterDefinitions);
|
||||
ResultSet query(StoreRef store, String language, String query,
|
||||
QueryParameterDefinition[] queryParameterDefinitions);
|
||||
|
||||
|
||||
/**
|
||||
@@ -114,14 +127,14 @@ public interface SearchService
|
||||
* @return Returns the query results
|
||||
*/
|
||||
@Auditable(parameters = {"store", "queryId", "queryParameters"})
|
||||
public ResultSet query(StoreRef store, QName queryId, QueryParameter[] queryParameters);
|
||||
ResultSet query(StoreRef store, QName queryId, QueryParameter[] queryParameters);
|
||||
|
||||
/**
|
||||
* Search using the given SearchParameters
|
||||
*/
|
||||
|
||||
@Auditable(parameters = {"searchParameters"})
|
||||
public ResultSet query(SearchParameters searchParameters);
|
||||
ResultSet query(SearchParameters searchParameters);
|
||||
|
||||
/**
|
||||
* Select nodes using an xpath expression.
|
||||
@@ -143,8 +156,8 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks"},
|
||||
recordable = {true, true, true, false, true})
|
||||
public List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks)
|
||||
List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks)
|
||||
throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
@@ -169,8 +182,8 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks", "language"},
|
||||
recordable = {true, true, true, false, true, true})
|
||||
public List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language)
|
||||
List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language)
|
||||
throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
@@ -193,9 +206,9 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks"},
|
||||
recordable = {true, true, true, false, true})
|
||||
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks) throws InvalidNodeRefException, XPathException;
|
||||
List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks) throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
* Select properties using an xpath expression
|
||||
@@ -219,9 +232,9 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks", "language"},
|
||||
recordable = {true, true, true, false, true, true})
|
||||
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException;
|
||||
List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
* Search for string pattern in both the node text (if present) and node
|
||||
@@ -236,7 +249,7 @@ public interface SearchService
|
||||
* @return Returns true if the pattern could be found - uses the default OR operator
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "googleLikePattern"})
|
||||
public boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern)
|
||||
boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern)
|
||||
throws InvalidNodeRefException;
|
||||
|
||||
/**
|
||||
@@ -252,7 +265,7 @@ public interface SearchService
|
||||
* @return Returns true if the pattern could be found
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "googleLikePattern", "defaultOperator"})
|
||||
public boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern, SearchParameters.Operator defaultOperator)
|
||||
boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern, SearchParameters.Operator defaultOperator)
|
||||
throws InvalidNodeRefException;
|
||||
|
||||
/**
|
||||
@@ -270,6 +283,6 @@ public interface SearchService
|
||||
* @return Returns true if the pattern could be found
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "sqlLikePattern", "includeFTS"})
|
||||
public boolean like(NodeRef nodeRef, QName propertyQName, String sqlLikePattern, boolean includeFTS)
|
||||
boolean like(NodeRef nodeRef, QName propertyQName, String sqlLikePattern, boolean includeFTS)
|
||||
throws InvalidNodeRefException;
|
||||
}
|
||||
|
@@ -118,7 +118,7 @@ public class StatsGet extends DeclarativeWebScript
|
||||
Pair<LocalDate, LocalDate> startAndEnd = getStartAndEndDates(req.getParameter("startDate"),req.getParameter("endDate"));
|
||||
query = buildQuery(siteInfo, facetKey, startAndEnd);
|
||||
|
||||
StatsParameters params = new StatsParameters(SearchService.LANGUAGE_SOLR_FTS_ALFRESCO, query, false);
|
||||
StatsParameters params = new StatsParameters(SearchService.LANGUAGE_INDEX_FTS_ALFRESCO, query, false);
|
||||
//params.addSort(new SortDefinition(SortDefinition.SortType.FIELD, this.statsField, false));
|
||||
params.addStatsParameter(StatsParameters.PARAM_FIELD, this.statsField);
|
||||
params.addStatsParameter(StatsParameters.PARAM_FACET, StatsParameters.FACET_PREFIX+propFacet.toString());
|
||||
|
@@ -123,7 +123,7 @@ public class SearchSQLApiWebscript extends AbstractWebScript implements Recogniz
|
||||
public SearchParameters buildSearchParameters(SearchSQLQuery searchQuery)
|
||||
{
|
||||
SearchParameters sparams = new SearchParameters();
|
||||
sparams.setLanguage(SearchService.LANGUAGE_SOLR_SQL);
|
||||
sparams.setLanguage(SearchService.LANGUAGE_INDEX_SQL);
|
||||
sparams.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
|
||||
if(StringUtils.isEmpty(searchQuery.getStmt()))
|
||||
{
|
||||
|
@@ -377,7 +377,7 @@ public class SearchMapperTests
|
||||
|
||||
try
|
||||
{
|
||||
searchParameters.setLanguage(SearchService.LANGUAGE_SOLR_ALFRESCO);
|
||||
searchParameters.setLanguage(SearchService.LANGUAGE_INDEX_ALFRESCO);
|
||||
searchMapper.fromFilterQuery(searchParameters, Arrays.asList(new FilterQuery(null, null, null)));
|
||||
fail();
|
||||
}
|
||||
|
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.search.impl;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.search.impl.lucene.AbstractLuceneQueryLanguage;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
|
||||
public class UnsupportedQueryLanguage extends AbstractLuceneQueryLanguage {
|
||||
@Override
|
||||
public ResultSet executeQuery(SearchParameters searchParameters) {
|
||||
throw new AlfrescoRuntimeException("No support for language " + searchParameters.getLanguage());
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -81,7 +81,7 @@ public class SolrCategoryServiceImpl extends AbstractCategoryServiceImpl
|
||||
String field = "@" + catProperty;
|
||||
|
||||
SearchParameters sp = new SearchParameters();
|
||||
sp.setLanguage(SearchService.LANGUAGE_SOLR_FTS_ALFRESCO);
|
||||
sp.setLanguage(SearchService.LANGUAGE_INDEX_FTS_ALFRESCO);
|
||||
sp.addStore(storeRef);
|
||||
sp.setQuery(catProperty+":*");
|
||||
FieldFacet ff = new FieldFacet(field);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -55,7 +55,7 @@ public class SolrStatsService implements StatsService
|
||||
searchParameters.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
|
||||
|
||||
LuceneQueryLanguageSPI language = searcher.getQueryLanguages().get(searchParameters.getLanguage().toLowerCase());
|
||||
if (language != null && SearchService.LANGUAGE_SOLR_FTS_ALFRESCO.equals(language.getName()))
|
||||
if (language != null && SearchService.LANGUAGE_INDEX_FTS_ALFRESCO.equals(language.getName()))
|
||||
{
|
||||
SolrQueryLanguage solr = (SolrQueryLanguage) language;
|
||||
return solr.executeStatsQuery(searchParameters);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -42,7 +42,7 @@ public class SolrXPathQueryLanguage extends AbstractLuceneQueryLanguage
|
||||
{
|
||||
String query = "PATH:\""+searchParameters.getQuery()+"\"";
|
||||
SearchParameters sp = searchParameters.copy();
|
||||
sp.setLanguage(SearchService.LANGUAGE_SOLR_FTS_ALFRESCO);
|
||||
sp.setLanguage(SearchService.LANGUAGE_INDEX_FTS_ALFRESCO);
|
||||
sp.setQuery(query);
|
||||
return solrQueryLanguage.executeQuery(sp);
|
||||
}
|
||||
|
@@ -107,7 +107,7 @@
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-fts-alfresco</value>
|
||||
<value>index-fts-alfresco</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-cmis</value>
|
||||
<value>index-cmis</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
@@ -41,7 +41,7 @@
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-cmis</value>
|
||||
<value>index-cmis</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
|
@@ -51,12 +51,16 @@
|
||||
<property name="languageMappings">
|
||||
<map>
|
||||
<entry key="lucene" value="alfresco" />
|
||||
<entry key="solr-alfresco" value="alfresco" />
|
||||
<entry key="index-alfresco" value="alfresco" />
|
||||
<entry key="cmis-strict" value="cmis" />
|
||||
<entry key="cmis-alfresco" value="cmis" />
|
||||
<entry key="solr-cmis" value="cmis" />
|
||||
<entry key="index-cmis" value="cmis" />
|
||||
<entry key="fts-alfresco" value="afts" />
|
||||
<entry key="index-fts-alfresco" value="afts" />
|
||||
<!-- Old solr language names-->
|
||||
<entry key="solr-fts-alfresco" value="afts" />
|
||||
<entry key="solr-cmis" value="cmis" />
|
||||
<entry key="solr-alfresco" value="alfresco" />
|
||||
</map>
|
||||
</property>
|
||||
<property name="storeMappings">
|
||||
@@ -165,21 +169,21 @@
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<bean id="search.index.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-alfresco</value>
|
||||
<value>index-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="search.lucene.xpath" class="org.alfresco.repo.search.impl.solr.SolrXPathQueryLanguage" >
|
||||
<property name="solrQueryLanguage" >
|
||||
<ref bean="search.fts.alfresco.index" />
|
||||
@@ -195,6 +199,36 @@
|
||||
</bean>
|
||||
|
||||
<bean id="search.fts.alfresco.index" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>index-fts-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!--queryLanguage instances with legacy names-->
|
||||
<bean id="search.index.cmis" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>index-cmis</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.fts.alfresco.solr" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
@@ -222,6 +256,20 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.indexerAndSearcherFactory" class="org.alfresco.repo.service.StoreRedirectorProxyFactory">
|
||||
<property name="proxyInterface">
|
||||
<value>org.alfresco.repo.search.IndexerAndSearcher</value>
|
||||
|
@@ -41,7 +41,7 @@
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-cmis</value>
|
||||
<value>index-cmis</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
|
@@ -52,12 +52,16 @@
|
||||
<property name="languageMappings">
|
||||
<map>
|
||||
<entry key="lucene" value="alfresco" />
|
||||
<entry key="solr-alfresco" value="alfresco" />
|
||||
<entry key="index-alfresco" value="alfresco" />
|
||||
<entry key="cmis-strict" value="cmis" />
|
||||
<entry key="cmis-alfresco" value="cmis" />
|
||||
<entry key="solr-cmis" value="cmis" />
|
||||
<entry key="index-cmis" value="cmis" />
|
||||
<entry key="fts-alfresco" value="afts" />
|
||||
<entry key="index-fts-alfresco" value="afts" />
|
||||
<!-- Old solr language names-->
|
||||
<entry key="solr-fts-alfresco" value="afts" />
|
||||
<entry key="solr-cmis" value="cmis" />
|
||||
<entry key="solr-alfresco" value="alfresco" />
|
||||
</map>
|
||||
</property>
|
||||
<property name="storeMappings">
|
||||
@@ -186,19 +190,18 @@
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<bean id="search.index.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-alfresco</value>
|
||||
<value>index-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="search.lucene.xpath" class="org.alfresco.repo.search.impl.solr.SolrXPathQueryLanguage" >
|
||||
@@ -216,6 +219,35 @@
|
||||
</bean>
|
||||
|
||||
<bean id="search.fts.alfresco.index" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>index-fts-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.index.cmis" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>index-cmis</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--queryLanguage instances with legacy names-->
|
||||
<bean id="search.fts.alfresco.solr" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
@@ -243,6 +275,20 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.indexerAndSearcherFactory" class="org.alfresco.repo.service.StoreRedirectorProxyFactory">
|
||||
<property name="proxyInterface">
|
||||
<value>org.alfresco.repo.search.IndexerAndSearcher</value>
|
||||
|
@@ -41,7 +41,7 @@
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-cmis</value>
|
||||
<value>index-cmis</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
|
@@ -52,12 +52,16 @@
|
||||
<property name="languageMappings">
|
||||
<map>
|
||||
<entry key="lucene" value="alfresco" />
|
||||
<entry key="solr-alfresco" value="alfresco" />
|
||||
<entry key="index-alfresco" value="alfresco" />
|
||||
<entry key="cmis-strict" value="cmis" />
|
||||
<entry key="cmis-alfresco" value="cmis" />
|
||||
<entry key="solr-cmis" value="cmis" />
|
||||
<entry key="index-cmis" value="cmis" />
|
||||
<entry key="fts-alfresco" value="afts" />
|
||||
<entry key="index-fts-alfresco" value="afts" />
|
||||
<!-- Old solr language names-->
|
||||
<entry key="solr-fts-alfresco" value="afts" />
|
||||
<entry key="solr-cmis" value="cmis" />
|
||||
<entry key="solr-alfresco" value="alfresco" />
|
||||
</map>
|
||||
</property>
|
||||
<property name="storeMappings">
|
||||
@@ -203,14 +207,14 @@
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<bean id="search.index.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-alfresco</value>
|
||||
<value>index-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
@@ -239,26 +243,55 @@
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-fts-alfresco</value>
|
||||
<value>index-fts-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
<!-- Adding solr SQL language. -->
|
||||
<bean id="search.solr.sql.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage">
|
||||
<bean id="search.index.sql.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage">
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-sql</value>
|
||||
<value>index-sql</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrSQLQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="search.index.cmis" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>index-cmis</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--queryLanguage instances with legacy names-->
|
||||
<bean id="search.fts.alfresco.solr" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-fts-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.cmis" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
@@ -273,6 +306,34 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage" >
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-alfresco</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.solr.sql.alfresco" class="org.alfresco.repo.search.impl.solr.SolrQueryLanguage">
|
||||
<property name="factories">
|
||||
<list>
|
||||
<ref bean="search.indexerAndSearcherFactory" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>solr-sql</value>
|
||||
</property>
|
||||
<property name="solrQueryHTTPClient">
|
||||
<ref bean="search.solrSQLQueryHTTPCLient" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="search.indexerAndSearcherFactory" class="org.alfresco.repo.service.StoreRedirectorProxyFactory">
|
||||
<property name="proxyInterface">
|
||||
<value>org.alfresco.repo.search.IndexerAndSearcher</value>
|
||||
|
@@ -94,6 +94,11 @@ public class SolrQueryHTTPClientTest
|
||||
public static void setUpBeforeClass() throws Exception
|
||||
{
|
||||
Map<String, String> languageMappings = new HashMap<String, String>();
|
||||
languageMappings.put("index-alfresco", "alfresco");
|
||||
languageMappings.put("index-fts-alfresco", "afts");
|
||||
languageMappings.put("index-cmis", "cmis");
|
||||
|
||||
// Old solr language names
|
||||
languageMappings.put("solr-alfresco", "alfresco");
|
||||
languageMappings.put("solr-fts-alfresco", "afts");
|
||||
languageMappings.put("solr-cmis", "cmis");
|
||||
@@ -165,7 +170,7 @@ public class SolrQueryHTTPClientTest
|
||||
StringBuilder luceneQuery = new StringBuilder();
|
||||
luceneQuery.append(" +TYPE:\"" + ContentModel.TYPE_CONTENT + "\"");
|
||||
String filterQuery = "ANCESTOR:\"workspace://SpacesStore/a1c1a0a1-9d68-4912-b853-b3b277f31288\"";
|
||||
StatsParameters params = new StatsParameters(SearchService.LANGUAGE_SOLR_FTS_ALFRESCO, luceneQuery.toString(), filterQuery, false);
|
||||
StatsParameters params = new StatsParameters(SearchService.LANGUAGE_INDEX_FTS_ALFRESCO, luceneQuery.toString(), filterQuery, false);
|
||||
params.addSort(new SortDefinition(SortDefinition.SortType.FIELD, "contentsize", false));
|
||||
params.addStatsParameter(StatsParameters.PARAM_FIELD, "contentsize");
|
||||
params.addStatsParameter(StatsParameters.PARAM_FACET, StatsParameters.FACET_PREFIX + ContentModel.PROP_CREATED.toString());
|
||||
|
Reference in New Issue
Block a user