Alfresco 7.3.1 Docker - SearchService

5cnsuln7  于 2023-03-29  发布在  Docker
关注(0)|答案(1)|浏览(117)

我已经用java 17将alfresco版本从Community 5.2(zip版本)升级到了Community 7.3.1(Docker版本)。我已经迁移了数据库。
我的searchService方法不能找到带有自定义元数据的旧文档(在迁移之前),但它可以处理标准的alfresco元数据(例如:cm:created)。此外,它可以从共享接口正常工作。最后,它可以处理新文档(在迁移之后)。所以我认为SOLR没有问题。

这是我的代码:

public List<Map<String, Object>> searchDocuments(String idaipatient, String medecin, String typologie, String nomService,
        String documentDateRangeStart, String documentDateRangeEnd, String integrationDateRangeStart, String integrationDateRangeEnd, String origine) {
    
    ResultSet rs = null;
    List<Map<String, Object>> finalResult = new ArrayList<Map<String, Object>>();
    try {

        Map<String, Object> results = new HashMap<String, Object>();
        Map<String, Object> resultObject = new HashMap<String, Object>();
        String query = "TYPE:\"os:documed" + "\" "
                + "AND @os\\:idPatient:\"" + idaipatient + "\" "
                + "AND @os\\:medName:\"" + medecin + "\" "
                + "AND @os\\:typologie:\"" + typologie + "\" "
                + "AND @os\\:nomService:\"" + nomService + "\" "
                + "AND @cm\\:created:[\"" + integrationDateRangeStart + "\" TO \"" + integrationDateRangeEnd + "\"] "
                + "AND @os\\:docDate:[\"" + documentDateRangeStart + "\" TO \"" + documentDateRangeEnd + "\"] "
                + "AND @os\\:origine:\"" + origine + "\" ";
        logger.debug("Query : " + query);

        StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
        rs = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, query);
                
        if (rs.length() == 0) {
            logger.debug("Aucun résultat pour la recherche " + query);
            // initialisation Json retour
            resultObject.put("properties", initProperties());
            results.put("item", resultObject);
            results.put("nodeRef", "");
            finalResult.add(results);
        } else {
            logger.debug(rs.length() + " document(s) trouvé(s) pour la recherche " + query);
            /* Récupération et mise en forme des résultats */
            for (NodeRef item : rs.getNodeRefs()) {
                results = new HashMap<String, Object>();
                resultObject = new HashMap<String, Object>();       
                resultObject.put("properties", getProperties(item));
                results.put("item", resultObject);
                results.put("nodeRef", item.getId());
                
                finalResult.add(results);
            }
        }
    } catch (Exception e) {
        logger.debug("Erreur Recherche documents: {}", ExceptionUtils.getStackTrace(e));
        finalResult = new ArrayList<Map<String, Object>>();
        
    } finally {
        rs.close();
    }   
    return finalResult;
}

我的pom.xml:

<!-- Alfresco Maven Plugin version to use -->
    <alfresco.sdk.version>4.5.0</alfresco.sdk.version>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Properties used in dependency declarations, you don't need to change these -->
    <alfresco.groupId>org.alfresco</alfresco.groupId>
    <alfresco.bomDependencyArtifactId>acs-community-packaging</alfresco.bomDependencyArtifactId>
    <alfresco.platform.version>7.3.0</alfresco.platform.version>
    <alfresco.platform.docker.user>alfresco</alfresco.platform.docker.user>
    <alfresco.share.version>17.137</alfresco.share.version>
    <alfresco.share.docker.version>7.3.0</alfresco.share.docker.version>

    <!-- Docker images -->
    <docker.acs.image>alfresco/alfresco-content-repository-community</docker.acs.image>
    <docker.share.image>alfresco/alfresco-share</docker.share.image>

我怎么解决这个问题呢?当我从eclipse构建amp时,我没有错误...

jm81lzqq

jm81lzqq1#

发现:
我们必须更新alfresco-search-services/solrhome/conf/shared.properties文件并执行完整的重新索引
https://docs.alfresco.com/search-services/latest/config/indexing/#exact-term-search

相关问题