From 5618700d16536c61c978e8e9c152d189832d7e89 Mon Sep 17 00:00:00 2001 From: Elia Porciani Date: Mon, 26 Oct 2020 14:17:01 +0100 Subject: [PATCH] Feature/search 2446 (#90) * [SEARCH-2446] Changes for supporting ElasticSearchSearchService --- .../service/cmr/search/SearchService.java | 75 +++++++++++-------- .../repo/web/scripts/solr/StatsGet.java | 52 ++++++------- .../api/search/SearchSQLApiWebscript.java | 2 +- .../rest/api/search/SearchMapperTests.java | 2 +- .../search/impl/UnsupportedQueryLanguage.java | 38 ++++++++++ .../impl/solr/SolrCategoryServiceImpl.java | 4 +- .../search/impl/solr/SolrStatsService.java | 52 ++++++------- .../impl/solr/SolrXPathQueryLanguage.java | 4 +- .../Search/noindex/noindex-search-context.xml | 4 +- .../Search/solr/opencmis-context.xml | 2 +- .../Search/solr/solr-search-context.xml | 60 +++++++++++++-- .../Search/solr4/opencmis-context.xml | 2 +- .../Search/solr4/solr-search-context.xml | 58 ++++++++++++-- .../Search/solr6/opencmis-context.xml | 2 +- .../Search/solr6/solr-search-context.xml | 75 +++++++++++++++++-- .../impl/solr/SolrQueryHTTPClientTest.java | 7 +- 16 files changed, 325 insertions(+), 114 deletions(-) create mode 100644 repository/src/main/java/org/alfresco/repo/search/impl/UnsupportedQueryLanguage.java diff --git a/data-model/src/main/java/org/alfresco/service/cmr/search/SearchService.java b/data-model/src/main/java/org/alfresco/service/cmr/search/SearchService.java index a15ec16e02..1387a29dc5 100644 --- a/data-model/src/main/java/org/alfresco/service/cmr/search/SearchService.java +++ b/data-model/src/main/java/org/alfresco/service/cmr/search/SearchService.java @@ -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"; - - public static final String LANGUAGE_SOLR_FTS_ALFRESCO = "solr-fts-alfresco"; - - public static final String LANGUAGE_CMIS_STRICT = "cmis-strict"; - - public static final String LANGUAGE_CMIS_ALFRESCO = "cmis-alfresco"; + String LANGUAGE_FTS_ALFRESCO = "fts-alfresco"; - public static final String LANGUAGE_SOLR_CMIS = "solr-cmis"; + String LANGUAGE_CMIS_STRICT = "cmis-strict"; - public static final String LANGUAGE_SOLR_ALFRESCO = "solr-alfresco"; - - public static final String LANGUAGE_SOLR_SQL = "solr-sql"; + String LANGUAGE_CMIS_ALFRESCO = "cmis-alfresco"; + + String LANGUAGE_INDEX_CMIS = "index-cmis"; + + String LANGUAGE_INDEX_ALFRESCO = "index-alfresco"; + + String LANGUAGE_INDEX_SQL = "index-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 selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, - NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks) + List 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 selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, - NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language) + List 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 selectProperties(NodeRef contextNodeRef, String xpath, - QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, - boolean followAllParentLinks) throws InvalidNodeRefException, XPathException; + List 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 selectProperties(NodeRef contextNodeRef, String xpath, - QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, - boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException; + List 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; } diff --git a/remote-api/src/main/java/org/alfresco/repo/web/scripts/solr/StatsGet.java b/remote-api/src/main/java/org/alfresco/repo/web/scripts/solr/StatsGet.java index 9dbce44358..4743457575 100644 --- a/remote-api/src/main/java/org/alfresco/repo/web/scripts/solr/StatsGet.java +++ b/remote-api/src/main/java/org/alfresco/repo/web/scripts/solr/StatsGet.java @@ -1,28 +1,28 @@ -/* - * #%L - * Alfresco Remote API - * %% - * Copyright (C) 2005 - 2016 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 . - * #L% - */ +/* + * #%L + * Alfresco Remote API + * %% + * Copyright (C) 2005 - 2016 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 . + * #L% + */ package org.alfresco.repo.web.scripts.solr; import java.util.HashMap; @@ -118,7 +118,7 @@ public class StatsGet extends DeclarativeWebScript Pair 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()); diff --git a/remote-api/src/main/java/org/alfresco/rest/api/search/SearchSQLApiWebscript.java b/remote-api/src/main/java/org/alfresco/rest/api/search/SearchSQLApiWebscript.java index 7bf3682ff7..d4b1452031 100644 --- a/remote-api/src/main/java/org/alfresco/rest/api/search/SearchSQLApiWebscript.java +++ b/remote-api/src/main/java/org/alfresco/rest/api/search/SearchSQLApiWebscript.java @@ -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())) { diff --git a/remote-api/src/test/java/org/alfresco/rest/api/search/SearchMapperTests.java b/remote-api/src/test/java/org/alfresco/rest/api/search/SearchMapperTests.java index a054f4761a..25aa4fada4 100644 --- a/remote-api/src/test/java/org/alfresco/rest/api/search/SearchMapperTests.java +++ b/remote-api/src/test/java/org/alfresco/rest/api/search/SearchMapperTests.java @@ -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(); } diff --git a/repository/src/main/java/org/alfresco/repo/search/impl/UnsupportedQueryLanguage.java b/repository/src/main/java/org/alfresco/repo/search/impl/UnsupportedQueryLanguage.java new file mode 100644 index 0000000000..dafd0aa7f6 --- /dev/null +++ b/repository/src/main/java/org/alfresco/repo/search/impl/UnsupportedQueryLanguage.java @@ -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 . + * #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()); + } +} diff --git a/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrCategoryServiceImpl.java b/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrCategoryServiceImpl.java index 7fc400d0fd..7981302dd2 100644 --- a/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrCategoryServiceImpl.java +++ b/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrCategoryServiceImpl.java @@ -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); diff --git a/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrStatsService.java b/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrStatsService.java index dd5c61f012..4cf963237d 100644 --- a/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrStatsService.java +++ b/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrStatsService.java @@ -1,28 +1,28 @@ -/* - * #%L - * Alfresco Repository - * %% - * Copyright (C) 2005 - 2016 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 . - * #L% - */ +/* + * #%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 . + * #L% + */ package org.alfresco.repo.search.impl.solr; import org.alfresco.repo.search.IndexerAndSearcher; @@ -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); diff --git a/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrXPathQueryLanguage.java b/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrXPathQueryLanguage.java index 28e80aa1a4..44e7a2bcbf 100644 --- a/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrXPathQueryLanguage.java +++ b/repository/src/main/java/org/alfresco/repo/search/impl/solr/SolrXPathQueryLanguage.java @@ -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); } diff --git a/repository/src/main/resources/alfresco/subsystems/Search/noindex/noindex-search-context.xml b/repository/src/main/resources/alfresco/subsystems/Search/noindex/noindex-search-context.xml index fcbc8a3878..38876025c8 100644 --- a/repository/src/main/resources/alfresco/subsystems/Search/noindex/noindex-search-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Search/noindex/noindex-search-context.xml @@ -107,7 +107,7 @@ - solr-fts-alfresco + index-fts-alfresco @@ -118,7 +118,7 @@ - solr-cmis + index-cmis diff --git a/repository/src/main/resources/alfresco/subsystems/Search/solr/opencmis-context.xml b/repository/src/main/resources/alfresco/subsystems/Search/solr/opencmis-context.xml index e50eb33e8a..c3a91c9d82 100644 --- a/repository/src/main/resources/alfresco/subsystems/Search/solr/opencmis-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Search/solr/opencmis-context.xml @@ -41,7 +41,7 @@ - solr-cmis + index-cmis diff --git a/repository/src/main/resources/alfresco/subsystems/Search/solr/solr-search-context.xml b/repository/src/main/resources/alfresco/subsystems/Search/solr/solr-search-context.xml index 12924f7f93..757f153dfc 100644 --- a/repository/src/main/resources/alfresco/subsystems/Search/solr/solr-search-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Search/solr/solr-search-context.xml @@ -51,12 +51,16 @@ - + - + + + + + @@ -165,20 +169,20 @@ - + - solr-alfresco + index-alfresco - + @@ -195,6 +199,36 @@ + + + + + + + index-fts-alfresco + + + + + + + + + + + + + + + + index-cmis + + + + + + + @@ -207,7 +241,7 @@ - + @@ -221,6 +255,20 @@ + + + + + + + + + solr-alfresco + + + + + diff --git a/repository/src/main/resources/alfresco/subsystems/Search/solr4/opencmis-context.xml b/repository/src/main/resources/alfresco/subsystems/Search/solr4/opencmis-context.xml index d142cf10e8..34d9541897 100644 --- a/repository/src/main/resources/alfresco/subsystems/Search/solr4/opencmis-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Search/solr4/opencmis-context.xml @@ -41,7 +41,7 @@ - solr-cmis + index-cmis diff --git a/repository/src/main/resources/alfresco/subsystems/Search/solr4/solr-search-context.xml b/repository/src/main/resources/alfresco/subsystems/Search/solr4/solr-search-context.xml index 52f5a18f82..77cc6c039f 100644 --- a/repository/src/main/resources/alfresco/subsystems/Search/solr4/solr-search-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Search/solr4/solr-search-context.xml @@ -52,12 +52,16 @@ - + - + + + + + @@ -186,19 +190,18 @@ - + - solr-alfresco + index-alfresco - @@ -222,13 +225,42 @@ - solr-fts-alfresco + index-fts-alfresco + + + + + + + + index-cmis + + + + + + + + + + + + + + + solr-fts-alfresco + + + + + + @@ -242,6 +274,20 @@ + + + + + + + + + solr-alfresco + + + + + diff --git a/repository/src/main/resources/alfresco/subsystems/Search/solr6/opencmis-context.xml b/repository/src/main/resources/alfresco/subsystems/Search/solr6/opencmis-context.xml index d142cf10e8..34d9541897 100644 --- a/repository/src/main/resources/alfresco/subsystems/Search/solr6/opencmis-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Search/solr6/opencmis-context.xml @@ -41,7 +41,7 @@ - solr-cmis + index-cmis diff --git a/repository/src/main/resources/alfresco/subsystems/Search/solr6/solr-search-context.xml b/repository/src/main/resources/alfresco/subsystems/Search/solr6/solr-search-context.xml index acc0e055a1..5c5d83f415 100644 --- a/repository/src/main/resources/alfresco/subsystems/Search/solr6/solr-search-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Search/solr6/solr-search-context.xml @@ -52,12 +52,16 @@ - + - + + + + + @@ -203,14 +207,14 @@ - + - solr-alfresco + index-alfresco @@ -239,26 +243,55 @@ - solr-fts-alfresco + index-fts-alfresco - + - solr-sql + index-sql + + + + + + + + index-cmis + + + + + + + + + + + + + + + solr-fts-alfresco + + + + + + @@ -272,6 +305,34 @@ + + + + + + + + + solr-alfresco + + + + + + + + + + + + + + solr-sql + + + + + diff --git a/repository/src/test/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClientTest.java b/repository/src/test/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClientTest.java index dea9556974..0598a64d91 100644 --- a/repository/src/test/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClientTest.java +++ b/repository/src/test/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClientTest.java @@ -94,6 +94,11 @@ public class SolrQueryHTTPClientTest public static void setUpBeforeClass() throws Exception { Map languageMappings = new HashMap(); + 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());