0

我们如何在 Oracle UCM 上使用 collectionId 进行全文搜索?是否可以进行全文搜索以递归方式以 collectionId 参数开头?我做了一些试验(你可以看看下面),但如果我用 collectionId 测试,没有结果返回。

public List<UCMDocumentTemplate> fullTextSearchByFolderId(@WebParam(name = "searchCriteria")
    String paramSearchCriteria, @WebParam(name = "ucmFolderId")
    Long ucmFolderId) throws UCMDocumentSearchException
{
    List<UCMDocumentTemplate> documentTemplateList = new ArrayList<UCMDocumentTemplate>();
    String documentSearchCriteria = "";
    try
    {
        if (ucmFolderId != null)
            documentSearchCriteria = "xCollectionID <= <qsch>" + ucmFolderId + "</qsch> <AND>";
        documentSearchCriteria += "dDocFullText <substring> <qsch>" + paramSearchCriteria + "</qsch>";
        List<Properties> childDocumentList = UCM_API.fullTextSearch(documentSearchCriteria);
        UCMDocumentTemplate ucmDocumentTemplate = null;
        if (childDocumentList != null)
            for (Properties properties : childDocumentList)
            {
                ucmDocumentTemplate = transformToUCMDocumentTemplate(new UCMDocumentTemplate(), properties);
                documentTemplateList.add(ucmDocumentTemplate);
            }
    }
    catch (Exception e)
    {
        UCMDocumentSearchException exc = new UCMDocumentSearchException(documentSearchCriteria, e);
        System.err.println(exc.getCompleteCode());
        e.printStackTrace();
        throw exc;
    }
    return documentTemplateList;
}

public static List<Properties> fullTextSearch(String searchCriteria) throws Exception
{
List<Properties> resultList = null;
List<Field> fields = null;
Properties responseProperties = null;

Properties inputBinderProperties = new Properties();
inputBinderProperties.put("IdcService", "GET_SEARCH_RESULTS");
inputBinderProperties.put("QueryText", searchCriteria);
inputBinderProperties.put("SearchEngineName", "databasefulltext");
inputBinderProperties.put("ResultCount", "500");

DataBinder responseBinder = getExecutedResponseBinder(userName, inputBinderProperties);
DataResultSet resultSet = responseBinder.getResultSet("SearchResults");

fields = resultSet.getFields();
resultList = new ArrayList<Properties>();
for (DataObject dataObject : resultSet.getRows())
{
    responseProperties = new Properties();
    for (Field field : fields)
    {
        if (field.getType() == Field.Type.DATE && dataObject.getDate(field.getName()) != null)
            responseProperties.put(field.getName(), dataObject.getDate(field.getName()));
        else
            responseProperties.put(field.getName(), dataObject.get(field.getName()));
    }
    resultList.add(responseProperties);
}

return resultList;

}

4

1 回答 1

0

我找到了解决方案。向inputBinderProperties添加参数时,它可以正常工作

    inputBinderProperties.put("folderChildren", ucmFolderId);
于 2013-12-10T12:47:36.510 回答